Email template - Unmatched end


#1

Hi all,

Quick question. With the following template:

##########
Alert Description: {check_result.resultDescription} Date: {check_result.triggeredAt}
Stream ID: {stream.id} Stream title: {stream.title}
Stream description: {stream.description} Alert Condition Title: {alertCondition.title}
{if stream_url}Stream URL: {stream_url}${end}

Triggered condition: ${check_result.triggeredCondition}
##########

{if backlog}Last messages accounting for this alert: {foreach backlog message}
Message: {message.message} Source: {message.source}
Full Message: {message.fields.full_message} {end}{else} {end}

I’m getting an “unmatched end” when testing the alert. Any tips?

Thank you!


(Jochen) #2

You’re missing a few dollar signs in your template.

Here’s the reference for the template engine which is used for rendering the notification templates:
https://cdn.rawgit.com/DJCordhose/jmte/4.0.0/doc/index.html

Take a look at the default (working) template and work your way from there:


#3

That’s awesome! Thank you very much! I was looking for a working template but didn’t feel like writing down from the image in the documentation :slight_smile:Thanks for this!


#4

Now that I got this part working, I realized something else …

I’ve read the message only exists inside the context that we have in the template that was posted. Does this mean that I can’t include the message if it’s the first time an event takes place?

With the following template, I’ll never get the first message of an event. Or am I missing something?

Thank you!


(Jochen) #5

What exactly do you want to achieve?


#6

Basically trigger an alert with the content of the “message” field. From some quick testing, I noticed I only get the message if it is a reoccurrence, but I might have done something wrong.


(Jochen) #7

What exactly did you do to achieve that?


(system) #8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.