Load in the email template
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Luke Murphy 2020-04-10 12:34:20 +02:00
parent 40fa56e9a0
commit 45acb9f5c7
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
3 changed files with 38 additions and 0 deletions

View File

@ -52,6 +52,8 @@
with_items:
- src: config.json
dest: /var/lib/alerta/config.json
- src: email.tmpl
dest: /var/lib/alerta/email.tmpl
- name: Copy over the /app/ configurations
become: true
@ -71,6 +73,7 @@
dokku_storage:
app: alerta
mounts:
- /var/lib/alerta/email.tmpl:/app/email.tmpl
- /var/lib/alerta/alerta.conf:/app/alerta.conf
- /var/lib/alerta/alertad.conf:/app/alertad.conf
- /var/lib/alerta/config.json:/web/config.json

View File

@ -16,6 +16,7 @@ email_type = text
endpoint = http://localhost:8080/api
key = {{ alerta_mailer_api_key }}
mail_from = {{ mail_from }}
mail_template = /app/email.tmpl
mail_to = {{ mail_to }}
skip_mta = False
smtp_host = {{ smtp_host }}

View File

@ -0,0 +1,34 @@
------------------------------------------------------------
[{{ alert.status|title }}] {{ alert.environment }}: {{ alert.severity|title }} {{ alert.event }} on {{ alert.service|join(', ') }} {{ alert.resource }}
------------------------------------------------------------
Alert ID: {{ alert.id }}
Create Time: {{ alert.create_time }}
Environment: {{ alert.environment }}
Services: {{ alert.service|join(', ') }}
Resource: {{ alert.resource }}
Event: {{ alert.event }}
Group: {{ alert.group }}
Value: {{ alert.value }}
Severity: {{ alert.previous_severity|title}} -> {{ alert.severity|title }}
Status: {{ alert.status|title }}
Text: {{ alert.text }}
Duplicate Count: {{ alert.duplicate_count }}
Origin: {{ alert.origin }}
Tags: {{ alert.tags|join(', ') }}
{% for key,value in alert.attributes.items() -%}
{{ key|title }}: {{ value }}
{% endfor -%}
{% if alert.raw_data %}
Raw Data
{{ alert.raw_data }}
{% endif %}
Comrades! To Arms!
To acknowledge this alert visit this URL:
{{ dashboard_url }}/#/alert/{{ alert.id }}
Generated by {{ program }} on {{ hostname }} at {{ now }}