Add notification link in email template

Change-Id: Ibe0f8e4fadeb080b8e621095879a146d1f3e3abe
This commit is contained in:
Adrian Turjak 2018-02-14 09:41:59 +13:00
parent 405a4e9f4a
commit e720a51152
2 changed files with 10 additions and 4 deletions

View File

@ -72,10 +72,14 @@ class EmailNotification(NotificationEngine):
if settings.HORIZON_URL:
task_url = settings.HORIZON_URL
notification_url = settings.HORIZON_URL
if not task_url.endswith('/'):
task_url += '/'
task_url += 'management/tasks/'
task_url += 'management/tasks/%s' % task.uuid
notification_url += (
'management/notifications/%s' % notification.uuid)
context['task_url'] = task_url
context['notification_url'] = notification_url
if notification.error:
subject = "Error - %s notification" % task.task_type

View File

@ -25,9 +25,11 @@ Notification details:
uuid: {{ notification.uuid }}
notes:
{{ notification.notes|safe }}
{% if task_url %}
Task link:
{{ task_url }}{{ task.uuid }}
{{ task_url }}
{% endif %}
{% if notification.error and notification_url %}
Notification link:
{{ notification_url }}
{% endif %}