diff options
Diffstat (limited to 'test/js/third_party/nodemailer/process-nodemailer-fixture.js')
-rw-r--r-- | test/js/third_party/nodemailer/process-nodemailer-fixture.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/js/third_party/nodemailer/process-nodemailer-fixture.js b/test/js/third_party/nodemailer/process-nodemailer-fixture.js new file mode 100644 index 000000000..49ab6a516 --- /dev/null +++ b/test/js/third_party/nodemailer/process-nodemailer-fixture.js @@ -0,0 +1,20 @@ +const nodemailer = require("nodemailer"); +const transporter = nodemailer.createTransport({ + host: "smtp.sendgrid.net", + port: 587, + secure: false, + auth: { + user: "apikey", // generated ethereal user + pass: process.env.SMTP_SENDGRID_KEY, // generated ethereal password + }, +}); + +// send mail with defined transport object +let info = await transporter.sendMail({ + from: process.env.SMTP_SENDGRID_SENDER, // sender address + to: process.env.SMTP_SENDGRID_SENDER, // list of receivers + subject: "Hello ✔", // Subject line + text: "Hello world?", // plain text body + html: "<b>Hello world?</b>", // html body +}); +console.log(typeof info?.messageId === "string"); |