How to digest events for different push notifications?
I have a workflow that has three triggers: one email and two push notifications.
In the email template, I use the handlerbars helpers, but we don't have that for push. I tried adding a filter, but we can't access the
step.total_count
on the filters thought.
Any suggestion on how to implement that?
How can use the digest in this workflow to send different push notifications?
e.g.:
- w/o digest: you received a new reply
- with digest: you received N new replies7 Replies
oh, and one thing i forgot to mention, we have a
messageType
in the payload too. that's why we have two push notifications. one for each message type. which means, i was trying to do something like that on the filters: when payload.messageType equals text
and when step.total_count greater than 1
.@Obscene Burrito you can use pluralize helper for this usecase
https://docs.novu.co/content-creation-design/handlebars-helpers#pluralize
Currently we don't allow digest variables in filters
all steps after digest have access to digest related variables
yes. but is handlerbars available for push notifications too?
because my issue is that the notifications are not the same. for 1 event the push is "Name here replied" and for digest is "You have N new replies". so i was trying to filter for total_count to trigger different push notifications
@Obscene Burrito, you just advanced to level 2!
i could do the exact same approach i did for emails:
{{#equals step.total_count 1}}
{{else}}
{{/equals}}
but i don't think that's available for push
Is handlebar helpers not working for you in push editor?
that was my question. i didn't know if that was supposed to work or not.
i just tried and it works fine. thanks!