Discussion: Handlebars helper for digest/non digest
We allow our subscribers to decide whether or not they want digests enabled by putting a filter based on subscriber data on our digest steps.
The problem is that taking into account all the states in which a digest with a filter could leave the Handlebars template variables (no step.events, step.events but step.events.length = 1, and step.events.length > 1) results in a very janky template like the below
I think Novu should provide a Handlebars helper to abstract away the two required unless+equals branches so that the user does not need to duplicate the part of the template intended for non-digest/digests with a single event. I’m willing to write a PR to implement such a helper but thought I should discuss it here before opening an issue
The problem is that taking into account all the states in which a digest with a filter could leave the Handlebars template variables (no step.events, step.events but step.events.length = 1, and step.events.length > 1) results in a very janky template like the below
I think Novu should provide a Handlebars helper to abstract away the two required unless+equals branches so that the user does not need to duplicate the part of the template intended for non-digest/digests with a single event. I’m willing to write a PR to implement such a helper but thought I should discuss it here before opening an issue