This PR add Inbound Email integration. It designed to support some variety of ESPs, but in prod we will use Mailgun, so locally I tested it only with mailgun ESP. **Important:** To make it work on different clusters I'm planning to provide different email domains for different regions, like ....@us.oncall.grafana.net, ...@eu.oncall.grafana.net --------- Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
from django.conf import settings
|
|
|
|
# Main
|
|
enabled = True
|
|
title = "Inbound Email"
|
|
slug = "inbound_email"
|
|
short_description = None
|
|
description = None
|
|
is_displayed_on_web = settings.FEATURE_INBOUND_EMAIL_ENABLED
|
|
is_featured = False
|
|
is_able_to_autoresolve = True
|
|
is_demo_alert_enabled = False
|
|
|
|
|
|
# Default templates
|
|
slack_title = """\
|
|
*<{{ grafana_oncall_link }}|#{{ grafana_oncall_incident_id }} {{ payload.get("subject", "Title undefined (check Slack Title Template)") }}>* via {{ integration_name }}
|
|
{% if source_link %}
|
|
(*<{{ source_link }}|source>*)
|
|
{%- endif %}"""
|
|
|
|
slack_message = "{{ payload.message }}"
|
|
|
|
slack_image_url = "{{ payload.image_url }}"
|
|
|
|
web_title = '{{ payload.get("subject", "Title undefined (check Web Title Template)") }}'
|
|
|
|
web_message = slack_message
|
|
|
|
web_image_url = slack_image_url
|
|
|
|
sms_title = web_title
|
|
|
|
phone_call_title = web_title
|
|
|
|
telegram_title = sms_title
|
|
|
|
telegram_message = slack_message
|
|
|
|
telegram_image_url = slack_image_url
|
|
|
|
source_link = None
|
|
|
|
grouping_id = '{{ payload.get("subject", "").upper() }}'
|
|
|
|
resolve_condition = '{{ payload.get("message", "").upper() == "OK" }}'
|
|
|
|
acknowledge_condition = None
|