Skip to content

Commit 036f39b

Browse files
authored
fix: update alt text for government logos in email templates (#422)
* fix: update alt text for government logos in email templates * chore: bump version * chore: bump version one higher so incident fix can go out first
1 parent 21a241b commit 036f39b

5 files changed

Lines changed: 14 additions & 10 deletions

File tree

.github/actions/waffles/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ docopt==0.6.2
22
Flask==2.3.3
33
markupsafe==2.1.5
44
setuptools==78.1.1 # required for distutils in Python 3.12
5-
git+https://github.com/cds-snc/notifier-utils.git@53.2.30#egg=notifications-utils
5+
git+https://github.com/cds-snc/notifier-utils.git@53.2.31#egg=notifications-utils

notifications_utils/jinja_templates/email/_fip_banner.jinja2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% if fip_banner_english %}
1010
<img
1111
src="https://assets.notification.canada.ca/gc-logo-en.png?20210531"
12-
alt="Government of Canada / Gouvernement du Canada"
12+
alt="Government of Canada"
1313
height="55"
1414
width="286"
1515
border="0"
@@ -19,7 +19,7 @@
1919
{% if fip_banner_french or brand_name == "canada.ca-fr" %}
2020
<img
2121
src="https://assets.notification.canada.ca/gc-logo-fr.png?20210531"
22-
alt="Gouvernement du Canada / Government of Canada"
22+
alt="Gouvernement du Canada"
2323
height="55"
2424
width="286"
2525
border="0"

notifications_utils/jinja_templates/email/email_preview_template.jinja2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<div style="margin: 20px auto 30px auto;">
4242
<img
4343
src="https://{{ asset_domain }}/gc-logo-en.png"
44-
alt="Government of Canada / Gouvernement du Canada"
44+
alt="Government of Canada"
4545
height="55"
4646
width="281"
4747
/>
@@ -52,7 +52,7 @@
5252
<div style="margin: 20px auto 30px auto;">
5353
<img
5454
src="https://{{ asset_domain }}/gc-logo-fr.png"
55-
alt="Gouvernement du Canada / Government of Canada"
55+
alt="Gouvernement du Canada"
5656
height="55"
5757
width="281"
5858
/>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "notifications-utils"
3-
version = "53.2.30"
3+
version = "53.2.31"
44
description = "Shared python code for Notification - Provides logging utils etc."
55
authors = ["Canadian Digital Service"]
66
license = "MIT license"

tests/test_template_types.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ def test_fip_banner_english(renderer, show_banner):
5050
email = renderer({"content": "hello world", "subject": ""})
5151
email.fip_banner_english = show_banner
5252
if show_banner:
53-
assert "gc-logo-en.png" in str(email)
54-
assert "canada-logo.png" in str(email)
53+
rendered_email = str(email)
54+
assert "gc-logo-en.png" in rendered_email
55+
assert "canada-logo.png" in rendered_email
56+
assert 'alt="Government of Canada"' in rendered_email
5557
else:
5658
assert "gc-logo-en.png" not in str(email)
5759
assert "canada-logo.png" not in str(email)
@@ -81,8 +83,10 @@ def test_fip_banner_french(renderer, show_banner):
8183
email.fip_banner_english = False
8284
email.fip_banner_french = show_banner
8385
if show_banner:
84-
assert "gc-logo-fr.png" in str(email)
85-
assert "canada-logo.png" in str(email)
86+
rendered_email = str(email)
87+
assert "gc-logo-fr.png" in rendered_email
88+
assert "canada-logo.png" in rendered_email
89+
assert 'alt="Gouvernement du Canada"' in rendered_email
8690
else:
8791
assert "gc-logo-fr.png" not in str(email)
8892
assert "canada-logo.png" not in str(email)

0 commit comments

Comments
 (0)