|
|
|
@ -31,25 +31,23 @@ router.post('/api/contact/:id', async (ctx) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const contact = contacts[id]
|
|
|
|
|
const {name, email, phone, preferredContact, message} = request.body
|
|
|
|
|
const {name, email, phone, message} = request.body
|
|
|
|
|
|
|
|
|
|
const emailBody =
|
|
|
|
|
`You have received a message via ${contact.site} from ${name}:
|
|
|
|
|
|
|
|
|
|
Contact info:
|
|
|
|
|
- ${email}
|
|
|
|
|
- ${phone}
|
|
|
|
|
|
|
|
|
|
Preferred method of contact:
|
|
|
|
|
- ${preferredContact}
|
|
|
|
|
- Name: ${name}
|
|
|
|
|
- Email: ${email}
|
|
|
|
|
- Phone: ${phone || 'None supplied'}
|
|
|
|
|
|
|
|
|
|
Message:
|
|
|
|
|
|
|
|
|
|
> ${message}
|
|
|
|
|
${message}
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
await transport.sendMail({
|
|
|
|
|
from: config.from || config.auth.user,
|
|
|
|
|
from: `tempest.dev Mailer <${config.from || config.auth.user}>`,
|
|
|
|
|
to: contact.address,
|
|
|
|
|
subject: contact.subject,
|
|
|
|
|
text: emailBody
|
|
|
|
|