Skip to content

Commit

Permalink
Pass custom subject in webhook destination
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Jul 11, 2019
1 parent 13cc325 commit b078866
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion redash/destinations/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ def notify(self, alert, query, user, new_state, app, host, options):
'event': 'alert_state_change',
'alert': serialize_alert(alert, full=False),
'url_base': host,
"description": alert.render_template()
}

data['alert']['description'] = alert.render_template()
data['alert']['title'] = alert.custom_subject

headers = {'Content-Type': 'application/json'}
auth = HTTPBasicAuth(options.get('username'), options.get('password')) if options.get('username') else None
resp = requests.post(options.get('url'), data=json_dumps(data), auth=auth, headers=headers, timeout=5.0)
Expand Down

0 comments on commit b078866

Please sign in to comment.