N
Novu2mo ago
Avinash

select which user should receive email or push

const novu = new Novu(process.env.NOVU_API_KEY); await novu.trigger('demo', { to: [{ subscriberId: "[email protected]", email: "[email protected]" }, { subscriberId: "[email protected]", email: "[email protected]" }], payload: { organization: { logo: 'https://evilcorp.com/logo.png', }, }, }); my demo flow contains two things email and push now i want to send only push notification to [email protected] and for [email protected] both email and push should be sent how can i achieve it
7 Replies
Pawan Jain
Pawan Jain2mo ago
@Avinash You can add step conditions (filters) for subscriber data in workflow
Eduardo Santos
Eduardo Santos2mo ago
@Pawan Jain can I create a filter to send Push only when the Subscriber has fcm deviceTokens? How can I do that?
Avinash
Avinash2mo ago
@Pawan Jain that step filters not present in @novu/node? no i need dynamic flow , somthing like this in the payload email: [{ subscriberId: "[email protected]" }] push:[{ subscriberId: "[email protected]" }, { subscriberId: "[email protected]" }] can we do that? @Pawan Jain
Pawan Jain
Pawan Jain2mo ago
@Avinash Currently step conditions are can be added from UI This is currently not supported
Avinash
Avinash2mo ago
Then we should have this functionality, cause our platform have that options where user can select wether they want email notifications or push, so we can pass users accordingly to novu to send email or push under one flow @Pawan Jain
Pawan Jain
Pawan Jain2mo ago
you can enable/disable channel of one workflow using subscriber preference https://docs.novu.co/concepts/preferences
Eduardo Santos
Eduardo Santos2mo ago
@Pawan Jain any idea on this?
Want results from more Discord servers?
Add your server