Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<img
src="https://{{ asset_domain }}/{{ brand_logo }}"
style="padding-left:0; display: block; border: 0; height:{% if brand_text -%} 27 {%- else -%} 108 {%- endif %}px"
alt="{% if brand_text %} {% else -%}{{ brand_name }}{%- endif %}"
alt="{% if brand_text %}{{ brand_text }}{% else -%}{{ brand_name }}{%- endif %}"
/>
</div>

Expand Down
4 changes: 2 additions & 2 deletions notifications_utils/jinja_templates/email_template.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
border="0"
style="display: block; border: 0;"
height="{% if brand_text -%} 27 {%- else -%} 54 {%- endif %}"
alt="{% if brand_text %} {% else -%}{{ brand_name }}{%- endif %}"
alt="{% if brand_text %}{{ brand_text }}{% else -%}{{ brand_name }}{%- endif %}"
/>
</td>
{% endif %}
Expand Down Expand Up @@ -132,7 +132,7 @@
<tr>
<td style="padding: 0 10px 0 {% if brand_colour %} 8px; border-left: solid 2px {{ brand_colour }}{% else %} 10px{% endif %}">
<img src="{{ brand_logo }}" style="display: block; border: 0" height="{% if brand_text -%} 27 {%- else -%} 108 {%- endif %}"
alt="{% if brand_text %} {% else -%}{{ brand_name }}{%- endif %}" />
alt="{% if brand_text %}{{ brand_text }}{% else -%}{{ brand_name }}{%- endif %}" />
</td>
<td width="100%" style="font-family: Helvetica, Arial, sans-serif; font-size: 18px; line-height: 23px;" valign="center">
{% if brand_text %}
Expand Down
6 changes: 3 additions & 3 deletions tests/test_template_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_alt_text_with_brand_text_and_fip_banner_english_shown(renderer):
brand_name="Notify Logo",
)
)
assert 'alt=" "' in email
assert 'alt="Example"' in email
assert 'alt="Notify Logo"' not in email


Expand Down Expand Up @@ -186,8 +186,8 @@ def test_alt_text_with_no_brand_text_and_fip_banner_french_shown(renderer):
"logo_with_background_colour, brand_text, expected_alt_text",
[
(True, None, 'alt="Notify Logo"'),
(True, "Example", 'alt=" "'),
(False, "Example", 'alt=" "'),
(True, "Example", 'alt="Example"'),
(False, "Example", 'alt="Example"'),
(False, None, 'alt="Notify Logo"'),
],
)
Expand Down