diff --git a/content/en/synthetics/notifications/_index.md b/content/en/synthetics/notifications/_index.md index 3537fad8bbd4d..a0db9f45235ef 100644 --- a/content/en/synthetics/notifications/_index.md +++ b/content/en/synthetics/notifications/_index.md @@ -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: @@ -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 diff --git a/content/en/synthetics/notifications/advanced_notifications.md b/content/en/synthetics/notifications/advanced_notifications.md index e18d348e8f3d9..cd2214a5f61a0 100644 --- a/content/en/synthetics/notifications/advanced_notifications.md +++ b/content/en/synthetics/notifications/advanced_notifications.md @@ -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 +``` + +