Browse Source

Send mEssage

master
Krisna Yana Javista 1 year ago
parent
commit
75333c61dc
2 changed files with 24 additions and 26 deletions
  1. +12
    -13
      index-nota.mjs
  2. +12
    -13
      index-payleter.mjs

+ 12
- 13
index-nota.mjs View File

@@ -36,17 +36,16 @@ function sendReceipt(message) {
subject: message.subject, subject: message.subject,
html: message.content, 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)
})
} }

+ 12
- 13
index-payleter.mjs View File

@@ -36,17 +36,16 @@ function sendReceipt(message) {
subject: message.subject, subject: message.subject,
html: message.content, 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)
})
} }

Loading…
Cancel
Save