Skip to content

Commit

Permalink
feat(worker): optimize contact request notification message
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaliske committed Jul 17, 2023
1 parent dc51b8e commit 319d165
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions workers/routes/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ Hi, Pascal!
A new contact request just came in:
Name: ${name?.length > 0 ? name : 'Unknown'}
Name: ${name?.length > 0 ? name : '[empty]'}
E-Mail: ${email}
Subject: ${subject}
${message}
Simply hit reply to answer this contact request. Over and out. 🤖
`
}

Expand Down Expand Up @@ -50,15 +52,15 @@ export const contact: () => Handler = () => {
headers.set('Content-Type', 'application/json')

const body: string = JSON.stringify({
from: { email: 'no-reply@pascaliske.dev', name: 'Pascal Iske' },
from: { email: 'no-reply@pascaliske.dev', name: 'Contact Form @ pascaliske.dev' },
// eslint-disable-next-line camelcase
reply_to: { email: data.email, name: data.name },
personalizations: [
{
to: [{ email: 'info@pascaliske.dev', name: 'Pascal Iske' }],
},
],
subject: `Contact Request from ${data.name}`,
subject: `Contact Request from ${data.name.length > 0 ? data.name : data.email}`,
content: [
{
type: 'text/plain',
Expand Down

0 comments on commit 319d165

Please sign in to comment.