Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert Notification doc #292

Merged
merged 5 commits into from
Oct 7, 2019
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
46 changes: 46 additions & 0 deletions src/pages/kb/user-guide/alerts/custom-alert-notifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
category: alerts
parent_category: user-guide
keywords:
- Alert
- Notification
- Template
- Custom Template
- Formatting
- Email
- Customize
- Customizing
title: Customizing Alert Notifications
slug: custom-alert-notifications
order: 1
---
Redash alerts can notify you when your queries match some arbitrary criteria. If you wish to modify the notification message, click the "Edit" button at the top of the alert page.

Next to the setting labeled "Template", click the dropdown and select "Custom template".
A box will appear, consisting of input fields for subject and body.

Any static content is valid, and you can also incorporate some built-in template variables:

* `ALERT_STATUS` - The evaluated alert [status]({% link _kb/user-guide/alerts/setting-up-an-alert.md %}#Alert-Status-&-Frequency) (string).
* `ALERT_CONDITION` - The alert [condition operator]({% link _kb/user-guide/alerts/setting-up-an-alert.md %}#Configuration-settings) (string).
* `ALERT_THRESHOLD` - The alert [threshold]({% link _kb/user-guide/alerts/setting-up-an-alert.md %}#Configuration-settings) (string or number).
* `ALERT_NAME` - The alert name (string).
* `ALERT_URL` - The alert page url (string).
* `QUERY_NAME` - The correlated query name (string).
* `QUERY_URL` - The correlated query page url (string).
* `QUERY_RESULT_VALUE` - The query result value (string or number)
* `QUERY_RESULT_ROWS` - The query result rows (value array)
* `QUERY_RESULT_COLS` - The query result columns (string array),

An example subject, for instance, could be:
```Alert "{{ALERT_NAME}}" changed status to {{ALERT_STATUS}}```

Click the "Preview" toggle button to preview the rendered result and save your changes by clicking the "Save" button.

{% callout warning %}

The preview is useful for verifying that template variables get rendered correctly. It is not an accurate representation of the eventual notification content, as each alert destinations can display notifications differently.

{% endcallout %}

To return to the default Redash message templates, reselect "Default template" at any time.
2 changes: 2 additions & 0 deletions src/pages/kb/user-guide/alerts/setting-up-an-alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Use the settings panel to configure your alert:

![](/assets/images/docs/gitbook/alerts_settings.png)

### Configuration settings

* **Value Column** is the column in your query result that you would like to watch.
* **Op** is short for "Operator". You can choose greater than, less than, or equal to.
* **Reference** is the absolute value that your _Value Column_ will be compared to. The most recent query result is shown as the **Value**
Expand Down