Skip to content

Commit 358aee4

Browse files
Merge pull request #1542 from IFRCGo/feature/dref-emails-1538
Fix email template
2 parents aaa0075 + cf0cc24 commit 358aee4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

dref/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import logging
2-
import docx
32

43
from typing import List, Any
54

65
from rest_framework import serializers
76

7+
from django.conf import settings
8+
89
from dref.models import (
910
Dref,
1011
PlannedIntervention,
@@ -575,6 +576,8 @@ def get_email_context(instance):
575576

576577
dref_data = DrefSerializer(instance).data
577578
email_context = {
579+
'id': dref_data['id'],
578580
'title': dref_data['title'],
581+
'frontend_url': settings.FRONTEND_URL,
579582
}
580583
return email_context

notifications/templates/email/dref/dref.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">
44
<tr>
55
<td align="center" class="pb-30" style="padding-bottom:30px;">
6-
You have been added to a DREF Application "DREF Tittle" (with an hyperlink to the application, http://localhost:3000/dref-application/X/edit/
6+
You have been added to a DREF Application: <a href="{{ frontend_url }}/dref-application/{{ id }}/edit/">{{ title }}</a>
77
</td>
88
</tr>
99
</table>

notifications/templates/email/dref/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
<tr>
400400

401401
<td class="text-header text-default text-right" style="text-align: right;color: #000000;font-family:'Lato', Arial, sans-serif;">
402-
<a href="{{ resource_url }}" target="_blank" class="link" style="font-family: 'Lato', Arial, sans-serif;text-decoration: underline;color: #000;">Open in GO</a>
402+
<a href="{{ frontend_url }}/dref-application/{{ id }}/edit/" target="_blank" class="link" style="font-family: 'Lato', Arial, sans-serif;text-decoration: underline;color: #000;">Open in GO</a>
403403
</td>
404404

405405
</tr>

0 commit comments

Comments
 (0)