Skip to content

Commit 41b8ea4

Browse files
authored
fix(notifications): shrink the email footer notice and postal address (#4550)
The footer notice drops to 12px and the postal address to 11px, so the address reads as the least important line. A non-breaking space keeps the Unsubscribe link on the same line as the end of its sentence.
1 parent e62952e commit 41b8ea4

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎apps/notifications/src/modules/notifications/services/email-sender/email-layout.spec.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe(renderEmailLayout.name, () => {
107107
it("renders the footer", () => {
108108
const { html } = setup({});
109109
expect(html).toContain(
110-
`<p class="footer-text" style="margin:0;font-size:13px;line-height:1.6;color:#71717a;">Sent by Akash Console. You're receiving this because you have an Akash Console account.</p>`
110+
`<p class="footer-text" style="margin:0;font-size:12px;line-height:1.6;color:#71717a;">Sent by Akash Console. You're receiving this because you have an Akash Console account.</p>`
111111
);
112112
});
113113

@@ -125,7 +125,7 @@ describe(renderEmailLayout.name, () => {
125125
const { html } = setup({ unsubscribe: { url: "https://console.akash.network/unsubscribe?token=abc" } });
126126

127127
expect(html).toContain(
128-
`<p class="footer-text" style="margin:0;font-size:13px;line-height:1.6;color:#71717a;">You're receiving this because you're subscribed to product updates from Akash Console. <a href="https://console.akash.network/unsubscribe?token=abc" style="color:inherit;text-decoration:underline;">Unsubscribe</a></p>`
128+
`<p class="footer-text" style="margin:0;font-size:12px;line-height:1.6;color:#71717a;">You're receiving this because you're subscribed to product updates from Akash Console.&nbsp;<a href="https://console.akash.network/unsubscribe?token=abc" style="color:inherit;text-decoration:underline;">Unsubscribe</a></p>`
129129
);
130130
expect(html).not.toContain("because you have an Akash Console account");
131131
});
@@ -137,7 +137,7 @@ describe(renderEmailLayout.name, () => {
137137
});
138138

139139
expect(html).toContain(
140-
`<p class="footer-text" style="margin:8px 0 0 0;font-size:13px;line-height:1.6;color:#71717a;">1 Market St, San Francisco, CA 94105</p>`
140+
`<p class="footer-text" style="margin:8px 0 0 0;font-size:11px;line-height:1.5;color:#71717a;">1 Market St, San Francisco, CA 94105</p>`
141141
);
142142
});
143143

‎apps/notifications/src/modules/notifications/services/email-sender/email-layout.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ function renderCode(code?: string): string {
6565
</div>`;
6666
}
6767

68-
const FOOTER_TEXT_STYLE = "font-size:13px;line-height:1.6;color:#71717a;";
68+
const FOOTER_TEXT_STYLE = "font-size:12px;line-height:1.6;color:#71717a;";
69+
const POSTAL_ADDRESS_STYLE = "font-size:11px;line-height:1.5;color:#71717a;";
6970

7071
/** CAN-SPAM requires a promotional email to say how to opt out and to carry the sender's postal address. */
7172
function renderFooterNotice({ unsubscribe, postalAddress }: { unsubscribe?: { url: string }; postalAddress?: string }): string {
@@ -74,7 +75,7 @@ function renderFooterNotice({ unsubscribe, postalAddress }: { unsubscribe?: { ur
7475
}
7576

7677
const unsubscribeLink = `<a href="${escape(unsubscribe.url)}" style="color:inherit;text-decoration:underline;">Unsubscribe</a>`;
77-
const notice = `<p class="footer-text" style="margin:0;${FOOTER_TEXT_STYLE}">You're receiving this because you're subscribed to product updates from Akash Console. ${unsubscribeLink}</p>`;
78+
const notice = `<p class="footer-text" style="margin:0;${FOOTER_TEXT_STYLE}">You're receiving this because you're subscribed to product updates from Akash Console.&nbsp;${unsubscribeLink}</p>`;
7879

7980
if (!postalAddress) {
8081
return notice;
@@ -83,7 +84,7 @@ function renderFooterNotice({ unsubscribe, postalAddress }: { unsubscribe?: { ur
8384
const postalAddressLines = postalAddress.split(/\r?\n/).map(line => escape(line));
8485

8586
return `${notice}
86-
<p class="footer-text" style="margin:8px 0 0 0;${FOOTER_TEXT_STYLE}">${postalAddressLines.join("<br>")}</p>`;
87+
<p class="footer-text" style="margin:8px 0 0 0;${POSTAL_ADDRESS_STYLE}">${postalAddressLines.join("<br>")}</p>`;
8788
}
8889

8990
/** The subject is user-controlled for alert emails, so it is escaped; content must already be sanitized by the caller. */

0 commit comments

Comments
 (0)