Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPP-3901: update disabled mask email content #5156

Merged
merged 1 commit into from
Oct 30, 2024
Merged
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
6 changes: 5 additions & 1 deletion emails/templates/emails/direct_email_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@
}
}
</style>

{% if pretext_ftlmsg_id %}
<div style="display:none !important; color: #ffffff; font-size: 0px; line-height: 0; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the point of this section?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To implement "preheader text" as shown in the figma. I had to look it up too: https://www.activecampaign.com/blog/email-preheader

{% ftlmsg pretext_ftlmsg_id %}
</div>
{% endif %}
<!-- temporary header -->
<table id="relay-email-header" width="100%" bgcolor="#3D3D3D" style="background: #3D3D3D; padding: 12px; margin-bottom: 30px; margin-top: 30px; width: 96%; border-radius: 6px; max-width: 1200px;" align="center">
<tr>
Expand Down
12 changes: 6 additions & 6 deletions emails/templates/emails/disabled_mask_for_spam.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% load email_extras %}
{% withftl bundle='privaterelay.ftl_bundles.main' language=language %}

{% include "emails/direct_email_header.html" %}
{% include "emails/direct_email_header.html" with pretext_ftlmsg_id="relay-deactivated-mask-email-pretext" %}

<style>
.button {
Expand Down Expand Up @@ -37,28 +37,28 @@
<td style="max-width:850px; padding-top: 0px; padding-bottom: 0px; text-align: center;">
<h2 style="font-family: inter medium, Arial, system-ui, sans-serif;">
<img width="18" src="{{ SITE_ORIGIN }}/static/images/email-images/warning.png" style="margin: 0 5px;" alt="warning icon"/>
{% ftlmsg 'reactivate-your-mask' %}
{% ftlmsg 'relay-deactivated-mask-email-subject' %}
</h2>
</td>
</tr>
<tr>
<td style="max-width:850px; padding-top: 0px; padding-bottom: 0px;">
<p style="line-height: 1.5; margin-bottom: 1.5em">
{% ftlmsg 'relay-received-spam-complaint-and-deactivated-mask-html' mask=mask %}
{% ftlmsg 'relay-received-spam-complaint-and-deactivated-mask' mask=mask %}
</p>
<p style="line-height: 1.5; margin-bottom: 1.5em">
{% ftlmsg 'reactivate-mask-detail-html' mask_url=mask_url %}
{% ftlmsg 'relay-remove-email-blocking-html' mask_url=mask_url %}
</p>
<p style="line-height: 1.5; margin-bottom: 1.5em">
{% ftlmsg 'learn-about-blocking-html' learn_more_url='https://support.mozilla.org/kb/disable-email-forwarding-stop-receiving-emails-sent-through-masks' %}
{% ftlmsg 'detailed-instructions-about-blocking-html' learn_more_url='https://support.mozilla.org/kb/disable-email-forwarding-stop-receiving-emails-sent-through-masks' %}
</p>
</td>
</tr>
<tr>
<td style="max-width:850px; padding-top: 20px; padding-bottom: 20px; text-align: center;">
<a href="{{ mask_url }}"
target="_blank" class="button" style="color: #FFFFFF;" rel="noreferrer">
{% ftlmsg 'reactivate-your-mask' %}
{% ftlmsg 'remove-email-blocking' %}
</a>
</td>
</tr>
Expand Down
7 changes: 4 additions & 3 deletions emails/templates/emails/disabled_mask_for_spam.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{% load ftl %}
{% load email_extras %}
{% withftl bundle='privaterelay.ftl_bundles.main' language=language %}
{% ftlmsg 'relay-deactivated-your-mask' %}
{% ftlmsg 'relay-deactivated-mask-email-subject' %}

{% ftlmsg 'relay-received-spam-complaint-and-deactivated-mask' mask=mask %}
{% with mask|striptags|urlencode as mask_url %}
{% ftlmsg 'reactivate-mask-detail' %}
{% ftlmsg 'relay-remove-email-blocking' %}

{{ SITE_ORIGIN }}/accounts/profile/#{{ mask_url }}
{% endwith %}

{% ftlmsg 'learn-about-blocking' learn_more_url='https://support.mozilla.org/kb/disable-email-forwarding-stop-receiving-emails-sent-through-masks' %}
{% ftlmsg 'detailed-instructions-about-blocking' learn_more_url='https://support.mozilla.org/kb/disable-email-forwarding-stop-receiving-emails-sent-through-masks' %}
{% endwithftl %}
50 changes: 31 additions & 19 deletions emails/tests/fixtures/disabled_mask_for_spam_expected.email
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Subject: =?utf-8?q?=E2=81=A8Firefox_Relay=E2=81=A9?= has deactivated one of
your email masks.
Subject: This mask has been deactivated
From: [email protected]
To: [email protected]
MIME-Version: 1.0
Expand All @@ -13,20 +12,23 @@ Content-Transfer-Encoding: quoted-printable



=E2=81=A8Firefox Relay=E2=81=A9 has deactivated one of your email masks.
This mask has been deactivated

An email from your mask address, [email protected]=E2=81=A9, was ma=
rked as spam. When this happens, =E2=81=A8Firefox Relay=E2=81=A9 deactivates =
the mask and stops forwarding emails.
the mask and blocks emails from forwarding to protect your inbox from future =
spam.

To remove email blocking:
1. Go to your =E2=81=A8Relay=E2=81=A9 dashboard and find this email mask
2. Remove email blocking by updating blocking from all to none

To reactivate your mask, remove email blocking on your =E2=81=A8Firefox Relay=
=E2=81=A9 dashboard.
http://127.0.0.1:8000/accounts/profile/#w41fwbt4q%40test.com


Learn about blocking and email forwarding at =E2=81=A8https://support.mozilla=
.org/kb/disable-email-forwarding-stop-receiving-emails-sent-through-masks=E2=
=81=A9
Detailed instructions to remove email blocking: =E2=81=A8https://support.mozi=
lla.org/kb/disable-email-forwarding-stop-receiving-emails-sent-through-masks=
=E2=81=A9


--==[BOUNDARY0]==
Expand Down Expand Up @@ -208,6 +210,12 @@ lay.firefox.com/fonts/Inter/Inter-Medium.027d14e7d35b.woff2?v=3D3.18) format(=
}
</style>

<div style=3D"display:none !important; color: #ffffff; font-size: 0px; li=
ne-height: 0; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; =
mso-hide: all;">
Remove email blocking to use your email mask
</div>

<!-- temporary header -->
<table id=3D"relay-email-header" width=3D"100%" bgcolor=3D"#3D3D3D" style=
=3D"background: #3D3D3D; padding: 12px; margin-bottom: 30px; margin-top: 30px=
Expand Down Expand Up @@ -261,27 +269,31 @@ px; text-align: center;">
s-serif;">
<img width=3D"18" src=3D"http://127.0.0.1:8000/static/ima=
ges/email-images/warning.png" style=3D"margin: 0 5px;" alt=3D"warning icon"/>
Reactivate your email mask
This mask has been deactivated
</h2>
</td>
</tr>
<tr>
<td style=3D"max-width:850px; padding-top: 0px; padding-bottom: 0=
px;">
<p style=3D"line-height: 1.5; margin-bottom: 1.5em">
An email from your mask address, [email protected], was =
marked as spam. When this happens, Firefox Relay deactivates the mask and sto=
ps forwarding emails.
An email from your mask address, =E2=81=A8w41fwbt4q@test.=
com=E2=81=A9, was marked as spam. When this happens, =E2=81=A8Firefox Relay=
=E2=81=A9 deactivates the mask and blocks emails from forwarding to protect y=
our inbox from future spam.
</p>
<p style=3D"line-height: 1.5; margin-bottom: 1.5em">
To reactivate your mask, <a href=3D"http://127.0.0.1:8000=
/accounts/profile/#w41fwbt4q%40test.com">remove email blocking</a> on your Fi=
refox Relay dashboard.
To remove email blocking:
<ol>
<li><a href=3D"http://127.0.0.1:8000/accounts/profile/#w41fwbt4q%40test.com">=
Go to your Relay dashboard</a> and find this email mask</li>
<li>Remove email blocking by updating blocking from all to none</li>
</ol>
</p>
<p style=3D"line-height: 1.5; margin-bottom: 1.5em">
<a href=3D"https://support.mozilla.org/kb/disable-email-f=
orwarding-stop-receiving-emails-sent-through-masks">Learn about blocking and =
email forwarding</a>
orwarding-stop-receiving-emails-sent-through-masks">Detailed instructions to =
remove email blocking</a>
</p>
</td>
</tr>
Expand All @@ -292,7 +304,7 @@ email forwarding</a>
test.com"
target=3D"_blank" class=3D"button" style=3D"color: #FFFFFF;=
" rel=3D"noreferrer">
Reactivate your email mask
Remove email blocking
</a>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions emails/tests/views_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ def test_complaint_with_auto_block_spam_disables_mask(self):
assert call.kwargs["Source"] == settings.RELAY_FROM_ADDRESS
assert call.kwargs["Destinations"] == [self.user.email]
msg_without_newlines = call.kwargs["RawMessage"]["Data"].replace("\n", "")
assert "deactivated one of your email masks" in msg_without_newlines
assert "This mask has been deactivated" in msg_without_newlines
assert self.ra.full_address in msg_without_newlines

mm.assert_incr_once("fx.private.relay.send_disabled_mask_email")
Expand Down Expand Up @@ -1401,7 +1401,7 @@ def test_build_disabled_mask_for_spam_email(self):

msg = _build_disabled_mask_for_spam_email(relay_address)

assert msg["Subject"] == main.format("relay-deactivated-your-mask")
assert msg["Subject"] == main.format("relay-deactivated-mask-email-subject")
assert msg["From"] == settings.RELAY_FROM_ADDRESS
assert msg["To"] == free_user.email

Expand Down
2 changes: 1 addition & 1 deletion emails/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ def _build_disabled_mask_for_spam_email(

# Create the message
msg = EmailMessage()
msg["Subject"] = ftl_bundle.format("relay-deactivated-your-mask")
msg["Subject"] = ftl_bundle.format("relay-deactivated-mask-email-subject")
msg["From"] = settings.RELAY_FROM_ADDRESS
msg["To"] = mask.user.email
msg.set_content(text_body)
Expand Down
30 changes: 16 additions & 14 deletions privaterelay/pending_locales/en/pending.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,32 @@
## Email sent to users when Relay deactivates their mask after the user marks a forwarded
## email as spam.

relay-deactivated-your-mask = { -brand-name-firefox-relay } has deactivated one of your email masks.
relay-deactivated-mask-email-subject = This mask has been deactivated

reactivate-your-mask = Reactivate your email mask
relay-deactivated-mask-email-pretext = Remove email blocking to use your email mask

# Variables
# $mask (string) - the Relay email mask that sent a spam complaint
relay-received-spam-complaint-and-deactivated-mask-html = An email from your mask address, { $mask }, was marked as spam. When this happens, { -brand-name-firefox-relay } deactivates the mask and stops forwarding emails.
relay-received-spam-complaint-and-deactivated-mask = An email from your mask address, { $mask }, was marked as spam. When this happens, { -brand-name-firefox-relay } deactivates the mask and blocks emails from forwarding to protect your inbox from future spam.

# Variables
# $mask (string) - the Relay email mask that sent a spam complaint
relay-received-spam-complaint-and-deactivated-mask = An email from your mask address, { $mask }, was marked as spam. When this happens, { -brand-name-firefox-relay } deactivates the mask and stops forwarding emails.

# Variables
# $mask_url (string) - url takes user to Relay dashboard with mask selected
reactivate-mask-detail-html = To reactivate your mask, <a href="{ $mask_url }">remove email blocking</a> on your { -brand-name-firefox-relay } dashboard.
relay-remove-email-blocking-html =
To remove email blocking:
<ol>
<li><a href="{ $mask_url }">Go to your { -brand-name-relay } dashboard</a> and find this email mask</li>
<li>Remove email blocking by updating blocking from all to none</li>
</ol>

reactivate-mask-detail = To reactivate your mask, remove email blocking on your { -brand-name-firefox-relay } dashboard.
relay-remove-email-blocking =
To remove email blocking:
1. Go to your { -brand-name-relay } dashboard and find this email mask
2. Remove email blocking by updating blocking from all to none

# Variables
# $learn_more_url (string) - support.mozilla.org page with more information
learn-about-blocking-html = <a href="{ $learn_more_url }">Learn about blocking and email forwarding</a>
detailed-instructions-about-blocking-html = <a href="{ $learn_more_url }">Detailed instructions to remove email blocking</a>

# Variables
# $learn_more_url (string) - support.mozilla.org page with more information
learn-about-blocking = Learn about blocking and email forwarding at { $learn_more_url }
detailed-instructions-about-blocking = Detailed instructions to remove email blocking: { $learn_more_url }

re-enable-your-mask = Visit your { -brand-name-firefox-relay } dashboard to re-enable this mask.
remove-email-blocking = Remove email blocking