Skip to content

Commit 8ee9a6a

Browse files
committed
new template
1 parent f006db9 commit 8ee9a6a

File tree

3 files changed

+70
-47
lines changed

3 files changed

+70
-47
lines changed

src/api/routes/stripe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const stripeRoutes: FastifyPluginAsync = async (fastify, _options) => {
296296
payload: {
297297
to: [unmarshalledEntry.userId],
298298
subject: `Payment Recieved for Invoice ${unmarshalledEntry.invoiceId}`,
299-
content: `We're writing to notify you that ACM @ UIUC has received ${paidInFull ? "full" : "partial"} payment for Invoice ${unmarshalledEntry.invoiceId} (${withCurrency} by ${name} <${email}>).\n\nPlease contact Officer Board with any questions.`,
299+
content: `ACM @ UIUC has received ${paidInFull ? "full" : "partial"} payment for Invoice ${unmarshalledEntry.invoiceId} (${withCurrency} by ${name}, ${email}).\n\nPlease contact Officer Board with any questions.`,
300300
},
301301
};
302302
if (!fastify.sqsClient) {

src/api/sqs/handlers/emailNotifications.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export const emailNotificationsHandler: SQSHandlerFunction<
2727
AvailableSQSFunctions.EmailNotifications
2828
> = async (payload, metadata, logger) => {
2929
const { to, cc, bcc, content, subject } = payload;
30-
const senderEmail = `ACM @ UIUC <notifications@${currentEnvironmentConfig.EmailDomain}>`;
30+
const senderEmailAddress = `notifications@${currentEnvironmentConfig.EmailDomain}`;
31+
const senderEmail = `ACM @ UIUC <${senderEmailAddress}>`;
3132
logger.info("Constructing email...");
3233
const command = new SendEmailCommand({
3334
Source: senderEmail,
@@ -43,7 +44,11 @@ export const emailNotificationsHandler: SQSHandlerFunction<
4344
},
4445
Body: {
4546
Html: {
46-
Data: compiledTemplate(payload),
47+
Data: compiledTemplate({
48+
...payload,
49+
id: metadata.reqId,
50+
from: senderEmailAddress,
51+
}),
4752
Charset: "UTF-8",
4853
},
4954
Text: {
Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,68 @@
11
const template = /*html*/ `
22
<!doctype html>
33
<html>
4-
<head>
5-
<title>{{ subject }}</title>
6-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7-
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
8-
<base target="_blank">
9-
<style>
10-
body {
11-
background-color: #F0F1F3;
12-
font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, sans-serif;
13-
font-size: 15px;
14-
line-height: 26px;
15-
margin: 0;
16-
color: #444;
17-
}
18-
</style>
19-
</head>
20-
<body style="background-color: #F0F1F3;font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, sans-serif;font-size: 15px;line-height: 26px;margin: 0;color: #444;">
21-
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color: #F0F1F3;">
22-
<tr>
23-
<td align="center" style="padding: 30px;">
24-
<table width="525" border="0" cellpadding="0" cellspacing="0" style="width: 525px; max-width: 525px; background-color: #ffffff; border-radius: 5px;">
25-
<tr>
26-
<td align="center" style="padding-top: 30px;">
27-
<img src="https://static.acm.illinois.edu/banner-blue.png" style="height: 100px; width: 210px; display: block; margin: 0 auto;" alt="ACM UIUC Logo"/>
28-
</td>
29-
</tr>
30-
<tr>
31-
<td style="padding: 30px;">
32-
{{nl2br content}}
33-
</td>
34-
</tr>
35-
<tr>
36-
<td align="center" style="padding-bottom: 30px;">
37-
<p style="font-size: 12px; color: #888; text-align: center;">
38-
<a href="https://acm.illinois.edu" style="color: #888;">ACM @ UIUC Homepage</a>
39-
<a href="mailto:[email protected]" style="color: #888; margin-left: 5px;">Email ACM @ UIUC</a>
40-
</p>
41-
</td>
42-
</tr>
43-
</table>
44-
</td>
45-
</tr>
46-
</table>
47-
</body>
4+
5+
<head>
6+
<title>{{ subject }}</title>
7+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
9+
<base target="_blank">
10+
<style>
11+
body {
12+
background-color: #F0F1F3;
13+
font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, sans-serif;
14+
font-size: 15px;
15+
line-height: 26px;
16+
margin: 0;
17+
color: #444;
18+
}
19+
</style>
20+
</head>
21+
22+
<body
23+
style="background-color: #F0F1F3;font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, sans-serif;font-size: 15px;line-height: 26px;margin: 0;color: #444;">
24+
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color: #F0F1F3;">
25+
<tr>
26+
<td align="center" style="padding: 30px;">
27+
<table width="525" border="0" cellpadding="0" cellspacing="0"
28+
style="width: 525px; max-width: 525px; background-color: #ffffff; border-radius: 5px;">
29+
<tr>
30+
<td align="center" style="padding-top: 30px;"> <img src="https://static.acm.illinois.edu/banner-blue.png"
31+
style="height: 100px; width: 210px; display: block; margin: 0 auto;" alt="ACM UIUC Logo" /> </td>
32+
</tr>
33+
<tr>
34+
<td style="padding: 30px;"> {{nl2br content}} </td>
35+
</tr>
36+
<tr>
37+
<td align="center" style="padding-bottom: 30px;">
38+
<p style="font-size: 12px; color: #888; text-align: center;"> <a href="https://acm.illinois.edu"
39+
style="color: #888;">ACM @ UIUC Homepage</a> <a href="mailto:[email protected]"
40+
style="color: #888; margin-left: 5px;">Email ACM @ UIUC</a> </p>
41+
</td>
42+
</tr>
43+
</table>
44+
</td>
45+
</tr>
46+
<tr>
47+
<td align="center" style="padding: 15px 30px;">
48+
<table width="525" border="0" cellpadding="0" cellspacing="0" style="width: 525px; max-width: 525px;">
49+
<tr>
50+
<td style="padding: 0;">
51+
<hr style="border: none; border-top: 1px solid #ccc;">
52+
<p style="font-size: 12px; color: #888; margin-top: 15px;"> You cannot unsubscribe from transactional
53+
emails. To ensure delivery, add {{from}} to your address book. </p>
54+
<p style="font-size: 12px; color: #888; margin-top: 15px;"> Please do not respond to this message, as
55+
emails to this address are not monitored. </p>
56+
<p style="font-size: 12px; color: #888; margin-top: 15px;"> &copy; {{date "" format="YYYY"}} ACM @ UIUC.
57+
All trademarks are the property of their respective owners. </p>
58+
<p style="font-size: 12px; color: #888; margin-top: 45px;"> {{id}} </p>
59+
</td>
60+
</tr>
61+
</table>
62+
</td>
63+
</tr>
64+
</table>
65+
</body>
4866
</html>
4967
`;
5068
export default template;

0 commit comments

Comments
 (0)