Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions content/en/synthetics/notifications/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ You can customize notifications using:
- **[Custom notification display](#display-custom-notifications-message)**: Show only your custom message without default enriched content.
- **[Simulate notifications](#simulate-notifications)**: Test your notification messages by sending simulated notifications.

**Note**: For information about accessing local (config) variables, see the [Variables][6] section.

## Pre-filled monitor messages

Synthetic Monitoring provides pre-filled messages with metadata such as:
Expand Down Expand Up @@ -247,5 +249,6 @@ Simulated notifications include **[TEST]** in their subject lines and use a defa
[3]: /synthetics/notifications/conditional_alerting
[4]: /synthetics/notifications/advanced_notifications
[5]: /monitors/notifications
[6]: /synthetics/notifications/template_variables/?tab=testinfo#variables


27 changes: 27 additions & 0 deletions content/en/synthetics/notifications/advanced_notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,33 @@ Use `#each` to loop over dictionaries or lists. You can access:
Users: {{#each users}}`{{@key}}` ({{name}}){{#unless @last}}, {{/unless}}{{/each}}
```

### Use local (config) variables in a notification

```handlebars
Synthetic Test Failed!

Application: {{ synthetics.attributes.result.variables.config[APP_NAME].value }}
URL Tested: {{ synthetics.attributes.result.variables.config[APP_URL].value }}
Random value: {{ synthetics.attributes.result.variables.config[NAME].value }}

Test: {{ synthetics.attributes.test.name }} ({{ synthetics.attributes.test.id }})
Failed step: {{ synthetics.failed_step.name }}
Location: {{ synthetics.attributes.location.id }}
Result: {{ synthetics.result_url }}

@your-email
```

<div class="alert alert-tip">To loop through all config variables and print their values safely:

```handlebars
{{#each synthetics.attributes.result.variables.config}}
- {{@key}}: {{#if this.secure}}[secure]{{else}}{{this.value}}{{/if}}
{{/each}}
```

</div>

## Steps loop

```handlebars
Expand Down
2 changes: 2 additions & 0 deletions content/en/synthetics/notifications/template_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Template variables allow you to insert dynamic values from your test results and
Test failed at step {{synthetics.failed_step.name}} with error: {{synthetics.failed_step.failure.message}}.
```

**Note**: For information about accessing local (config) variables, see the [Variables](#variables) section.

### Common variable shortcuts

`{{synthetics.failed_step.name}}`
Expand Down
Loading