N
Novu7mo ago
SHG-TV

customize workflow steps digest

Hey, we like the templating functionality within a step and want to use the novu button within the custom code section. Is this possible with an variable or similar?
9 Replies
Ask Inkeep
Ask Inkeep7mo ago
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: * Glossary * Digest Engine * React * Tenants -----------------------------
Ask Inkeep
Ask Inkeep7mo ago
Answer Yes, you can customize the workflow steps including the use of variables within the templating functionality. While the direct documentation doesn't specifically mention using a Novu button within the custom code section, Novu supports templating options that allow for dynamic content. For instance, you can use Handlebars templating syntax to include conditions and variables within your templates (1) . An example given for templating logic is:
{{#each array}}
{{#if @last}} and
{{else}} {{#unless @first}} , {{/unless}}
{{/if}} {{this}}
{{/each}}
{{#each array}}
{{#if @last}} and
{{else}} {{#unless @first}} , {{/unless}}
{{/if}} {{this}}
{{/each}}
This example iterates over an array to format a list with commas and an "and" before the last item. Similar logic could be applied within your custom code section to dynamically include variables such as a Novu button or other elements based on your requirements. Ensure that the data you wish to use for such customization is properly passed to Novu as part of the payload when triggering events. This allows you to leverage the full capabilities of the templating engine to tailor the notification content. If you're specifically looking to embed interactive elements like buttons within emails or other notification channels, remember to ensure that the final rendered content adheres to the compatibility and security policies of the target platform or email client.
SHG-TV
SHG-TV7mo ago
@Ask Inkeep I am exspecialy looking for the button from the template section, not for another variable
Ask Inkeep
Ask Inkeep7mo ago
Thanks for the follow-up, @SHG-TV. I'll get back to you soon. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Template Store * Centralized multiple legacy implementations of different teams * Get notification * Vue Component -----------------------------
Ask Inkeep
Ask Inkeep7mo ago
Answer Currently, the information provided does not directly address the capability to use a specific button from the template section within custom code in the context you described. The documentation and discussions available do not detail a method for directly referencing a predefined button (like those available in the Novu template store) within custom code sections using a variable or a similar implementation. For customization and dynamic content within notifications, Novu supports templating and variables, but the direct inclusion of UI components from the template store into custom code through a simple variable reference might not be supported in the manner you're looking for (1) (2) . You might consider creating a custom button in the HTML of your templates and styling it according to your needs. This approach allows for flexibility in design and functionality within the limitations of the email clients or notification channels you're targeting. If this is a critical feature for your implementation, reviewing the most recent official documentation or reaching out to Novu's support through their official channels for any updates or workarounds that might have been introduced after the information sources were last updated could be beneficial.
Pawan Jain
Pawan Jain7mo ago
@SHG-TV If you are looking to add a button, then <button> tag can be used with styles
SHG-TV
SHG-TV7mo ago
@Pawan Jain I was looking for the button used within the template function and the global branding styles, so I dont have to build it myself using html xD
Pawan Jain
Pawan Jain7mo ago
@SHG-TV Apologies I am still confused looking for the button used within the template function could you please share any screenshot please?
SHG-TV
SHG-TV7mo ago
@Pawan Jain thats not an issue, I wanted to have a shortcut/function to use the html button generated with just a one-liner. we now have copied the button html and paste it at the right place.
Want results from more Discord servers?
Add your server