File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff 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+
610export 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" ;
Original file line number Diff line number Diff line change 11import { resend } from "./resend" ;
2- import { VARIANT_TO_FROM_MAP } from "./resend/constants" ;
2+ import { VARIANT_TO_FROM_MAP , RESEND_REPLY_TO } from "./resend/constants" ;
33import { 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,
You can’t perform that action at this time.
0 commit comments