Added better mail logging
parent
5f0ba524d2
commit
74635c17c8
5
index.js
5
index.js
|
@ -39,9 +39,10 @@ app.post('/', async (req, res) => {
|
|||
else from = 'Anonymous'
|
||||
|
||||
// Send email
|
||||
let mail_res;
|
||||
try {
|
||||
console.log(`Sending email from ${from}...`)
|
||||
await mailer.sendMail({
|
||||
mail_res = await mailer.sendMail({
|
||||
from: from,
|
||||
to: process.env.MAIL_TO,
|
||||
subject: req.body['subj'],
|
||||
|
@ -50,7 +51,7 @@ app.post('/', async (req, res) => {
|
|||
} catch (err) {
|
||||
return res.sendStatus(500)
|
||||
console.error(err)
|
||||
}
|
||||
} console.log(`Sent email ${mail_res.messageId}`)
|
||||
|
||||
// hcaptcha failed
|
||||
} else return res.sendStatus(403)
|
||||
|
|
Loading…
Reference in New Issue