Used variables in step are not shown
We are using the custom-code of email step and encounter the issue, taht used variables are not present, when used inside of #each of handlebars.
We are currently fixing this with invisible html.
Is there a better way or should this been tracked for a fix within an seperat github issue?
9 Replies
Hi @SHG-TV, I'm an AI assistant for Novu. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Ask Inkeep with any follow-up questions.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* General
* Send Your First Notification
* Handlebars & Helpers
* Email
-----------------------------
Answer
The issue you're encountering with variables not being shown when used inside the
#each
block of Handlebars in the custom-code of an email step seems to be a specific scenario not directly addressed in the available documentation. While the general use of Handlebars and custom code in Novu, including for emails, is supported and detailed in the documentation (1) (2) , your specific problem with the #each
block and variables might indeed warrant further investigation.
If this behavior is not documented as a limitation or a feature within Novu's official documentation, it could be beneficial to track this as a separate issue on GitHub. This would allow the Novu development team to investigate the issue further and potentially provide a fix or a more streamlined solution than using invisible HTML.
Remember to check existing issues on the Novu GitHub repository to see if anyone else has encountered a similar problem or if there's already an ongoing discussion about it. If not, creating a new issue with a detailed description of the problem, the steps to reproduce it, and mentioning how you're currently working around it could help the Novu team and community to offer more targeted assistance or improvements.Got it. Tagging @Support for additional help.
@Pawan Jain can you help out? Cc @Dima Grossman
@SHG-TV what are you doing right now? Can you explain the intermediate solution you use?
@Tomer Barnea example:
message.txt - full code input
image.png - you see variables are missing
in short we have a digest and a non-digest version of this step in place, but no variables in neigher of them are reconized
@SHG-TV
you see variables are missingDo you mean variables are not showing in right side variables view?
@Pawan Jain yes, and could therefore not be assigned as required variable (which we want to use)
our current workaround is to place a hidden div inside😇
=> which should not be a way to solve this forever 🙂
@SHG-TV
Yeah I agree. I will share it with the team