Skip to content

Commit e5655ea

Browse files
committed
Merge branch 'main' of github.com:CodeForAfrica/dub
2 parents 7f00779 + 0e87135 commit e5655ea

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

packages/email/src/resend/constants.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ export const RESEND_AUDIENCES = {
33
"partners.dub.co": "6caf6898-941a-45b6-a59f-d0780c3004ac",
44
};
55

6+
const primary = process.env.RESEND_EMAIL_FROM_PRIMARY || "Dub.co <system@dub.co>";
7+
const notifications = process.env.RESEND_EMAIL_FROM_NOTIFICATIONS || "Dub.co <notifications@mail.dub.co>";
8+
const marketing = process.env.RESEND_EMAIL_FROM_MARKETING || "Steven from Dub.co <steven@ship.dub.co>";
9+
610
export const VARIANT_TO_FROM_MAP = {
7-
primary: "CFA DUB <support@codeforafrica.org>",
8-
notifications: "CFA DUB <support@codeforafrica.org>",
9-
marketing: "CFA DUB <support@codeforafrica.org>",
11+
primary,
12+
notifications,
13+
marketing,
1014
};
15+
16+
export const RESEND_REPLY_TO = process.env.RESEND_EMAIL_REPLY_TO || "support@dub.co";

packages/email/src/send-via-resend.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { resend } from "./resend";
2-
import { VARIANT_TO_FROM_MAP } from "./resend/constants";
2+
import { VARIANT_TO_FROM_MAP, RESEND_REPLY_TO } from "./resend/constants";
33
import { ResendEmailOptions } from "./resend/types";
44

55
// Send email using Resend (Recommended for production)
@@ -16,7 +16,7 @@ export const sendEmailViaResend = async (opts: ResendEmailOptions) => {
1616
from,
1717
variant = "primary",
1818
bcc,
19-
replyTo,
19+
replyTo = RESEND_REPLY_TO,
2020
subject,
2121
text,
2222
react,
@@ -27,7 +27,7 @@ export const sendEmailViaResend = async (opts: ResendEmailOptions) => {
2727
to: email,
2828
from: from || VARIANT_TO_FROM_MAP[variant],
2929
bcc: bcc,
30-
replyTo: replyTo || "support@codeforafrica.org",
30+
replyTo,
3131
subject,
3232
text,
3333
react,

0 commit comments

Comments
 (0)