If I use topic subscription, is there a group selector in the digest?
Hi I am using topic subscription, Is it possible inside the digest to get a "groupBy" topic for the email Template? Criteria should be to see only the related Message to the subscriberID
12 Replies
Hi @gigo1980
Digest depends on workflow + subsciberId + custom digest key (if any).
Since topic is just group of subscribers.
When you trigger a workflow to a topic, internally it is triggered to all subscribers of topic.
groupBy
helper is used to group payload events by key nameread more about groupBy helper
https://docs.novu.co/content-creation-design/handlebars-helpers#groupby
What will be then here the right groupBy, If I would group by "from"?
if your payload is like this
Event 1
Event 2
Event 3
then this email template
will give you this result
in this line
Hallo Pawan du hast 3 neue Nachrichten.
Pawan is picked from subscriber.firstName
@gigo1980 let me know if I am able to explain correctlyOk great that works so far, is there also an way to aggreagate something like in linked in.
So that I can see the persons on my side, people how have written something, next birthdays and so on.
Can I do this in one Workflow or does I need for each "kind" and seperare workflow and nees something like an aggregation workflow?
Is there something like arrayLength?
Or is there a way to contribute custom handlebar functions to you project?
{{arrayLength yourArray}}
https://github.com/novuhq/novu/blob/next/packages/application-generic/src/usecases/compile-template/compile-template.usecase.ts <-- I think this might the right place for it
GitHub
novu/packages/application-generic/src/usecases/compile-template/com...
🔥 The open-source notification infrastructure with fully functional embedded notification center 🚀🚀🚀 - novuhq/novu
@gigo1980, you just advanced to level 2!
@gigo1980
Yes this is the correct place at code, where a new handlebar helper can be added
try this in our email editor
where payload is