diff --git a/index-nota.mjs b/index-nota.mjs index 03d36ca..9df873c 100644 --- a/index-nota.mjs +++ b/index-nota.mjs @@ -36,17 +36,16 @@ function sendReceipt(message) { subject: message.subject, html: message.content, } - // sgMail - // .send(msg) - // .then((response) => { - // if (response[0].statusCode == 202) { - // console.log(`Email sent to ${message.email} at ${now}`) - // } else { - // console.error(`Failed to send email to ${message.email} at ${now}`) - // } - // }) - // .catch((error) => { - // console.error(error) - // }) - console.log(`Email sent to ${message.email} at ${now}`) + sgMail + .send(msg) + .then((response) => { + if (response[0].statusCode == 202) { + console.log(`Email sent to ${message.email} at ${now}`) + } else { + console.error(`Failed to send email to ${message.email} at ${now}`) + } + }) + .catch((error) => { + console.error(error) + }) } diff --git a/index-payleter.mjs b/index-payleter.mjs index 5a58e0e..32af953 100644 --- a/index-payleter.mjs +++ b/index-payleter.mjs @@ -36,17 +36,16 @@ function sendReceipt(message) { subject: message.subject, html: message.content, } - // sgMail - // .send(msg) - // .then((response) => { - // if (response[0].statusCode == 202) { - // console.log(`Email sent to ${message.email} at ${now}`) - // } else { - // console.error(`Failed to send email to ${message.email} at ${now}`) - // } - // }) - // .catch((error) => { - // console.error(error) - // }) - console.log(`Email sent to ${message.email} at ${now}`) + sgMail + .send(msg) + .then((response) => { + if (response[0].statusCode == 202) { + console.log(`Email sent to ${message.email} at ${now}`) + } else { + console.error(`Failed to send email to ${message.email} at ${now}`) + } + }) + .catch((error) => { + console.error(error) + }) }