Skip to content

Commit e81b2a4

Browse files
committed
Add local unit local branch name in email context (#2368)
1 parent e714c32 commit e81b2a4

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

local_units/dev_views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ def get(self, request):
2828
if context is None:
2929
return HttpResponse("No context found for the email preview.")
3030

31+
context["local_branch_name"] = "Test Local Branch"
3132
template = loader.get_template("email/local_units/local_unit.html")
3233
return HttpResponse(template.render(context, request))

local_units/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def get_email_context(instance):
1111
local_unit_data = PrivateLocalUnitSerializer(instance).data
1212
email_context = {
1313
"id": local_unit_data["id"],
14+
"local_branch_name": local_unit_data["local_branch_name"],
1415
"frontend_url": settings.FRONTEND_URL,
1516
}
1617
return email_context

notifications/templates/email/local_units/local_unit.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,43 @@ <h3>Dear {{full_name}}</h3>
99
<tr>
1010
{% if new_local_unit %}
1111
<td align="center" class="pb-30">
12-
A new local unit has been added and is awaiting your validation. Kindly review the information and validate or delete as necessary.
12+
A new local unit "{{local_branch_name}}" has been added and is awaiting your validation. Kindly review the information and validate or delete as necessary.
1313
</td>
1414
{% endif %}
1515

1616
{% if update_local_unit %}
1717
<td align="center" class="pb-30">
18-
The local unit has been updated and is awaiting your validation. Kindly review the information and validate or delete as necessary.
18+
The local unit "{{local_branch_name}}" has been updated and is awaiting your validation. Kindly review the information and validate or delete as necessary.
1919
</td>
2020
{% endif %}
2121

2222
{% if validate_success %}
2323
<td align="center" class="pb-30">
24-
Your request for the local unit has been successfully validated. The local unit is now visible and marked as validated.
24+
Your request for the local unit "{{local_branch_name}}" has been successfully validated. The local unit is now visible and marked as validated.
2525
</td>
2626
{% endif %}
2727

2828
{% if revert_reason %}
2929
<td align="center" class="pb-30">
30-
Your local unit has been reverted. {{revert_reason}}. Please review and resubmit if applicable.
30+
Your local unit "{{local_branch_name}}" has been reverted. {{revert_reason}}. Please review and resubmit if applicable.
3131
</td>
3232
{% endif %}
3333

3434
{% if deprecate_local_unit %}
3535
<td align="center" class="pb-30">
36-
Your local unit has been deprecated. {{deprecate_reason}}. Please contact the administrator for more information.
36+
Your local unit "{{local_branch_name}}" has been deprecated. {{deprecate_reason}}. Please contact the administrator for more information.
3737
</td>
3838
{% endif %}
3939

4040
{% if is_validator_regional_admin %}
4141
<td align="center" class="pb-30">
42-
The new local unit has been pending validation for over 14 days. Kindly review and validate or delete as necessary.
42+
The new local unit "{{local_branch_name}}" has been pending validation for over 14 days. Kindly review and validate or delete as necessary.
4343
</td>
4444
{% endif %}
4545

4646
{% if is_validator_global_admin %}
4747
<td align="center" class="pb-30">
48-
The new local unit has been pending validation for over 28 days and requires your attention. Please review and validate
48+
The new local unit "{{local_branch_name}}" has been pending validation for over 28 days and requires your attention. Please review and validate
4949
or delete as necessary.
5050
</td>
5151
{% endif %}

0 commit comments

Comments
 (0)