From adefa09c69e630f93d95f6e8c2df7b626fc9b7b8 Mon Sep 17 00:00:00 2001 From: Joywin Bennis <107112207+joywin2003@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:52:40 +0530 Subject: [PATCH] Refactor: Update email subject and add text content in resend-mailer.ts --- src/lib/resend-mailer.ts | 3 ++- src/types/index.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/resend-mailer.ts b/src/lib/resend-mailer.ts index da097c9..3ad280b 100644 --- a/src/lib/resend-mailer.ts +++ b/src/lib/resend-mailer.ts @@ -9,12 +9,13 @@ export async function MailUsingResend({ email, name, OTP }: SendEmailType) { const mailOptions: ResendEmailOptions = { from: "Tedx SJEC ", to: email, - subject: "Email Verification", + subject: "Tedx SJEC - Your OTP for Email Verification", react: EmailTemplate({ name: name, OTP: OTP, email: email, }), + text: `Hello ${name},\n\nThank you for registering for Tedx 2024.\n\nYour One-Time Password (OTP) for email verification is:\n\n${OTP}\n\nPlease enter this OTP to complete your registration. The OTP is valid for 10 minutes.\n\nThank you!\n\nTedx SJEC Team`, }; const { data, error } = await resend.emails.send(mailOptions); diff --git a/src/types/index.ts b/src/types/index.ts index b507db3..cd1fde3 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -22,4 +22,5 @@ export interface ResendEmailOptions { to: string; subject: string; react: ReactNode; + text: string; } \ No newline at end of file