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
@Avinash
You can add step conditions (filters) for subscriber data in workflow
@Pawan Jain can I create a filter to send Push only when the Subscriber has fcm
deviceTokens
? How can I do that?@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
@Avinash
Currently
step conditions
are can be added from UI
This is currently not supportedThen 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
you can enable/disable channel of one workflow using subscriber preference
https://docs.novu.co/concepts/preferences
@Pawan Jain any idea on this?