diff --git a/src/app/[locale]/templates/email.js b/src/app/[locale]/templates/email.js index 0364b37..3a8cd9f 100644 --- a/src/app/[locale]/templates/email.js +++ b/src/app/[locale]/templates/email.js @@ -1,5 +1,5 @@ // minify html code by using this website: https://codebeautify.org/minify-html -const EmailTemplate = (embody) => `Email

LCP

Thank you for contact us! Here's the message:

Date: ${new Date().toUTCString()}

To: ${process.env.EMAIL_USER}

From: ${embody.email}

Name: ${embody.name}

Subject: ${embody.subject}

Body: ${embody.message}

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

Thank you for contact us! Here's the message:

Date: ${new Date().toUTCString()}

To: ${process.env.EMAIL_USER}

From: ${embody.email}

Name: ${embody.name}

Subject: ${embody.subject}

Body: ${embody.message}

`; export { EmailTemplate } \ No newline at end of file diff --git a/src/app/api/sendemail/route.ts b/src/app/api/sendemail/route.ts index 3d4b717..260a94b 100644 --- a/src/app/api/sendemail/route.ts +++ b/src/app/api/sendemail/route.ts @@ -9,7 +9,12 @@ export async function POST(req: any) { from: `"${body.name}" <${body.email}>`, subject: body.subject, text: `${body.message}\r\n Sent by ${body.email} (${body.name})`, - html: EmailTemplate(body) + html: EmailTemplate(body), + attachments: [{ + filename: 'logo_compact.png', + path: process.env.TYPEENV === 'production' ? "https://lcp-pi.vercel.app/images/logos/logo_compact.png" : "./public/images/logos/logo_compact.png", + cid: 'uniquelogo' + }] }; console.log(dataobj);