|
|
|
@ -36,17 +36,16 @@ function sendReceipt(message) {
|
|
|
|
subject: message.subject,
|
|
|
|
subject: message.subject,
|
|
|
|
html: message.content,
|
|
|
|
html: message.content,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// sgMail
|
|
|
|
sgMail
|
|
|
|
// .send(msg)
|
|
|
|
.send(msg)
|
|
|
|
// .then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
// if (response[0].statusCode == 202) {
|
|
|
|
if (response[0].statusCode == 202) {
|
|
|
|
// console.log(`Email sent to ${message.email} at ${now}`)
|
|
|
|
console.log(`Email sent to ${message.email} at ${now}`)
|
|
|
|
// } else {
|
|
|
|
} else {
|
|
|
|
// console.error(`Failed to send email to ${message.email} at ${now}`)
|
|
|
|
console.error(`Failed to send email to ${message.email} at ${now}`)
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// })
|
|
|
|
})
|
|
|
|
// .catch((error) => {
|
|
|
|
.catch((error) => {
|
|
|
|
// console.error(error)
|
|
|
|
console.error(error)
|
|
|
|
// })
|
|
|
|
})
|
|
|
|
console.log(`Email sent to ${message.email} at ${now}`)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|