Digest Messages
Hello! I'm using Novu 2.3.0 (self-hosted). And I'm trying to create a simple in-app step with a digest step before it. However I cannot find a way to make a simple loop inside the in-app step with the editor:
Hello {{subscriber.firstName}}!
Here is a summary of your recent updates ({{steps.digest-step.eventCount}}):
{{#each steps.digest.events}}
...content using this...
{{/each}}
Any ideas how can I make a loop? And for example to list all payload data from all accumulated messages.
2 Replies
Finally managed to do that:
Hello {{subscriber.firstName}}!
{% if steps.digest-step.eventCount > 10 %}
You have more than 10 recent updates. Here's a brief overview:
{% else %}
Here is a summary of your recent updates ({{ steps.digest-step.eventCount }}):
{% endif %}
{% for item in steps.digest-step.events %}
{{item.payload}}
{% endfor %}
The important thing is that the events are accessed trough the exact digest step identifier. And it also turned out that Novu in-app step editor supports (I don't know how fully) LiquidJS: https://liquidjs.com/tutorials/intro-to-liquid.html
@Pawan Jain, I would recommend to update the page: https://docs.novu.co/platform/workflow/digest. At least with few examples like this. It was not clear how to write a digest message. It was not clear that LiquidJS template language is supported. More info on that topic would be great. Thanks in advance!
Thanks for the feedback 🙏🏻
We will update the docs with examples
We will update the docs with examples