Skip to content

result of template({}) is cached #1985

Answered by jaylinski
bagheriali2001 asked this question in Q&A
Discussion options

You must be logged in to vote

By assigning the rendered template to your template-object (notification_data.text = text_template(details)), you are overwriting your notification_messages-templates with the rendered template, thus the template gets replaced with the result from the first text_template(...)-call.

This will work as expected:

const handlebars = require("handlebars");

const notification_messages = {
    values: [
        {
            id: "NOTIFICATION_ID",
            type: "support",
            text: "THIS IS A TEST TICKET NUM: {{ticket_num}} STATUS: {{status}}",
        },
        {
            id: "NOTIFICATION_ID2",
            type: "support",
            text: "THIS IS A TEST TICKET NUM: {{ticket_…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bagheriali2001
Comment options

Answer selected by bagheriali2001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1984 on August 23, 2023 21:34.