#Template variables

1 messages · Page 1 of 1 (latest)

drifting wharf
#

Hi guys, I am using v8 locally, and have created a very simple Vue web application using embed.umd.min.js to view the in-app notifications and axios to trigger simple notifications.

If I create a very simple template, with a title of 'Hello {{a}}' and trigger an event with the following payload:

    a: "a",
    b: "b",
    c: "c"
}```

I get a notification that just says 'Hello ' and the passed payload attribute is not included, but what is interesting is that I noticed the following payload returned from the API is (note that the `a` attribute is missing)

```payload: {
    a: "",
    b: "b",
    c: "c"
}```

If I update the title of the in-app notification to 'Hello {{b}}' and trigger the very same event, I see the same text in the notification 'Hello ' and the following payload returned by the API is:

```payload: {
    a: "a",
    b: "",
    c: "c"
}```

Each time, the variable included in the template is removed from the payload that is saved to mongodb. Am I doing something wrong?

The request is
#

And the API response is

#

The template is:

reef sail
#

I am also facing the same issue

vocal geyser
#

Hi! Are you using the self hosted version? Also, could you please check what happens if you put something in the default value (in the variables table at the bottom)?

reef sail
#

Yes, I am using the self hosted version. I will check with a default variable

drifting wharf
#

If a default value is configured that value willl be displayed in the outputted message regardless of sending the attribute in the payload.

#

If the value is marked as required, an error will be returned if the value is not sent it the payload, but regardless, the value if sent will not be displayed.

vocal geyser
#

Yes, this was already fixed, today-tomorrow v0.9.0 will be released and you should not have this problem anymore

drifting wharf
#

That is great news, thank you very much for your help.

eternal terraceBOT
#

@drifting wharf, you just advanced to level 1!

drifting wharf
#

Just to update, this is confirmed as fixed in v0.9, thanks again for your help.