From cc96c0539c5bd61550d4a56891094bc9ac37df46 Mon Sep 17 00:00:00 2001 From: Luigi Carvalho Date: Sun, 5 Nov 2023 10:19:37 +0000 Subject: [PATCH] formatted the email template --- src/app/[locale]/templates/email.js | 2 +- src/app/api/[locale]/sendemail/route.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/[locale]/templates/email.js b/src/app/[locale]/templates/email.js index 1134b44..faffdab 100644 --- a/src/app/[locale]/templates/email.js +++ b/src/app/[locale]/templates/email.js @@ -3,6 +3,6 @@ const dirv = "auto"; const year = new Date().getUTCFullYear(); const curdate = (locale) => `${locale ? new Date().toLocaleString(locale, { timeZone: 'UTC' }) : new Date().toLocaleDateString()}`; -const EmailTemplate = (embody, t) => `Email

${t.thankyoumsg ?? "Thank you for contact us! Here's the message:"}

${t.emaildate ?? "Date:"} ${curdate(t.lang)}

${t.emailto ?? "To:"} ${process.env.EMAIL_USER}

${t.emailfrom ?? "From:"} ${embody.email}

${t.emailname ?? "Name:"} ${embody.name}

${t.emailsubject ?? "Subject:"} ${embody.subject}

${t.emailbody ?? "Message:"} ${embody.message}

`; +const EmailTemplate = (embody, t) => `Email

${t.thankyoumsg ?? "Thank you for contact us! Here's the message:"}

${t.emaildate ?? "Date:"} ${curdate(t.lang)}

${t.emailto ?? "To:"} ${process.env.EMAIL_USER}

${t.emailfrom ?? "From:"} ${embody.email}

${t.emailname ?? "Name:"} ${embody.name}

${t.emailsubject ?? "Subject:"} ${embody.subject}

${t.emailbody ?? "Message:"}

${embody.message}

`; export { EmailTemplate } \ No newline at end of file diff --git a/src/app/api/[locale]/sendemail/route.ts b/src/app/api/[locale]/sendemail/route.ts index 3ba3c58..71b684a 100644 --- a/src/app/api/[locale]/sendemail/route.ts +++ b/src/app/api/[locale]/sendemail/route.ts @@ -20,9 +20,6 @@ export async function POST(req: any) { attachments: attachmentsobj }; - console.log(dataobj); - await sendMailUtil(dataobj); - return NextResponse.json({ dataobj }); } \ No newline at end of file