SendGrid. Отправка email-ов через пакет @sendgrid/mail
const sgMail = require("@sendgrid/mail");
sgMail.setApiKey(<API_токен>);
const msg = {
to: <email_адресат>,
from: <email_отправитель>,
subject: "Sending with Twilio SendGrid is Fun",
text: "and easy to do anywhere, even with Node.js",
html: "<strong>and easy to do anywhere, even with Node.js</strong>",
};
async function main() {
const [response] = await sgMail.send(msg);
console.log(response);
}
main();Last updated