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'
|
else from = 'Anonymous'
|
||||||
|
|
||||||
// Send email
|
// Send email
|
||||||
|
let mail_res;
|
||||||
try {
|
try {
|
||||||
console.log(`Sending email from ${from}...`)
|
console.log(`Sending email from ${from}...`)
|
||||||
await mailer.sendMail({
|
mail_res = await mailer.sendMail({
|
||||||
from: from,
|
from: from,
|
||||||
to: process.env.MAIL_TO,
|
to: process.env.MAIL_TO,
|
||||||
subject: req.body['subj'],
|
subject: req.body['subj'],
|
||||||
|
@ -50,7 +51,7 @@ app.post('/', async (req, res) => {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return res.sendStatus(500)
|
return res.sendStatus(500)
|
||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
} console.log(`Sent email ${mail_res.messageId}`)
|
||||||
|
|
||||||
// hcaptcha failed
|
// hcaptcha failed
|
||||||
} else return res.sendStatus(403)
|
} else return res.sendStatus(403)
|
||||||
|
|
Loading…
Reference in New Issue