Skip to content

Commit 8b3037a

Browse files
authored
Merge pull request #1806 from mertbagt/email-template-update
Email template update
2 parents 0b7581b + eda87c1 commit 8b3037a

File tree

10 files changed

+24
-17
lines changed

10 files changed

+24
-17
lines changed

functions/src/email/digestEmail.handlebars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<link rel="stylesheet" type="text/css" href="email/style.css" />
55
</head>
66

7-
<body class="font">
7+
<body style="background: white; width: 600px; min-height: 80vh; font-family: 'Nunito';
8+
font-style: normal">
89
{{> header }}
910

1011
{{> bills }}

functions/src/email/handlebarsHelpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const registerHelpers = () => {
1010
handlebars.registerHelper("addCounts", helpers.addCounts)
1111
handlebars.registerHelper("ifGreaterThan", helpers.ifGreaterThan)
1212
handlebars.registerHelper("isDefined", helpers.isDefined)
13+
handlebars.registerHelper("formatDate", helpers.formatDate)
1314
handlebars.registerHelper("minusFour", helpers.minusFour)
1415
handlebars.registerHelper("noUpdatesFormat", helpers.noUpdatesFormat)
1516
handlebars.registerHelper("toLowerCase", helpers.toLowerCase)

functions/src/email/helpers.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ export function isDefined(v: unknown) {
2222
return v !== undefined
2323
}
2424

25+
export function formatDate(timestamp: Date) {
26+
const date = new Date(timestamp)
27+
28+
return date.toLocaleDateString()
29+
}
30+
2531
export function minusFour(value: number) {
2632
const result = value - 4
2733
return result

functions/src/email/partials/bills/bills.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<section style="margin-left: 47.5px; margin-right: 47.5px; padding-bottom: 20px">
22
<div style="margin-bottom: 20px;">
3-
<h5 style="display: inline-block; font-weight: 600; font-size: 25px; line-height: 125%; margin-right: 20px; margin-bottom: 0px;
3+
<h5 style="display: inline-block; font-weight: 600; font-size: 25px; line-height: 125%; margin-right: 30px; margin-bottom: 0px;
44
color: #C71E32;">
55
Bills
66
</h5>

functions/src/email/partials/footer.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<footer style="margin: 20px 47.5px 0 47.5px">
1+
<footer style="width: 600px">
22
<hr style="height: 3px; border-width: 0; color: #101010; background-color: #101010">
33
<p style="font-weight: 600; font-size: 12px; line-height: 125%; letter-spacing: 0.03em;
44
color: #000000; margin-top: 36px">
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<div id="logo" style="background-color: #1a3185; padding: 16px 20px 16px 50px">
2-
<img src="email\images_no-svgs\Logo.png" alt="Maple Logo" />
3-
{{!-- On prod, replace with: --}}
4-
{{!-- <img src="https://mapletestimony.org/email/images_no-svgs/Logo.png" alt="Maple Logo" /> --}}
2+
<img src="https://mapletestimony.org/email/images_no-svgs/Logo.png" alt="Maple Logo" />
53
</div>
64

75
<header style="background-color: #FFFFFF; padding: 24px 0px 12px;
@@ -16,11 +14,9 @@
1614
of the Bills and Users you follow!
1715
</h2>
1816
<p class="subheadline blue center" style="font-weight: 600; font-size: 12px; line-height: 125%;
19-
color: #1a3185; display: block; margin: auto; width: 30%;">
20-
{{startDate}} - {{endDate}}
17+
color: #1a3185; display: block; margin: auto; width: 30%">
18+
{{formatDate startDate}} - {{formatDate endDate}}
2119
</p>
2220
</div>
23-
<img src="email\images_no-svgs\Mail Report.png" alt="Report" style="display: block; margin: auto; width: 32%;" />
24-
{{!-- On prod, replace with: --}}
25-
{{!-- <img src="https://mapletestimony.org/email/images_no-svgs/Mail Report.png" alt="Report" style="display: block; margin: auto; width: 32%;" /> --}}
21+
<img src="https://mapletestimony.org/email/images_no-svgs/Mail Report.png" alt="Report" style="display: block; margin: auto; width: 32%" />
2622
</header>

functions/src/email/partials/newsFeedLink.handlebars

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<nav style="background-color: #1a3185; color: #FFFFFF">
1+
<div id="nav" style="background-color: #1a3185; color: #FFFFFF; width: 600px">
22
<div style="display: block; margin: auto; width: 43%">
33
<p style="display: inline-block; font-weight: 500; font-size: 16px; line-height: 125%;
4-
letter-spacing: 0.015em; margin-right: 4px; margin-bottom: 0px;"
4+
letter-spacing: 0.015em; margin-right: 4px; margin-bottom: 0px"
55
>
66
see more at your
77
</p>
@@ -18,4 +18,4 @@
1818
</a>
1919
</p>
2020
</div>
21-
</nav>
21+
</div>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
<div class="noUpdatesIcon">
2-
<img src="/empty mail.svg" alt="Empty Mail" />
1+
<div style="padding-top: 12px; padding-bottom: 20px; display: block; margin: auto; width: 65%">
2+
<img src="https://mapletestimony.org/email/images_no-svgs/empty-mail.png" alt="Empty Mail" />
33
</div>
4-
<h5 class="noUpdatesTitle">No updates for
4+
<h5 style="font-weight: 600; font-size: 25px; line-height: 125%; margin-bottom: 0px;
5+
display: block; margin: auto; width: 65%; color: #000000"
6+
>No updates for
57
{{noUpdatesFormat notificationFrequency}}!
68
</h5>
2.06 KB
Loading

scripts/firebase-admin/sendTestEmail.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const EMAIL_TEMPLATE_PATH = "./functions/src/email/digestEmail.handlebars"
2222
handlebars.registerHelper("addCounts", helpers.addCounts)
2323
handlebars.registerHelper("ifGreaterThan", helpers.ifGreaterThan)
2424
handlebars.registerHelper("isDefined", helpers.isDefined)
25+
handlebars.registerHelper("formatDate", helpers.formatDate)
2526
handlebars.registerHelper("minusFour", helpers.minusFour)
2627
handlebars.registerHelper("noUpdatesFormat", helpers.noUpdatesFormat)
2728
handlebars.registerHelper("toLowerCase", helpers.toLowerCase)

0 commit comments

Comments
 (0)