diff options
author | 2023-07-04 19:41:37 -0300 | |
---|---|---|
committer | 2023-07-04 15:41:37 -0700 | |
commit | 3a93ddfab35841f242db0cdf472ce941bfa94984 (patch) | |
tree | 4a3b47ccca6f97cc87f2eb773e83f0af11db74e1 /test/js/third_party/nodemailer/process-nodemailer-fixture.js | |
parent | 979e99940374289e21332a0a7214889648e7397b (diff) | |
download | bun-v0.6.13.tar.gz bun-v0.6.13.tar.zst bun-v0.6.13.zip |
use sengrid account on nodemailer test (#3517)bun-v0.6.13
Diffstat (limited to 'test/js/third_party/nodemailer/process-nodemailer-fixture.js')
-rw-r--r-- | test/js/third_party/nodemailer/process-nodemailer-fixture.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/test/js/third_party/nodemailer/process-nodemailer-fixture.js b/test/js/third_party/nodemailer/process-nodemailer-fixture.js index a54735f26..49ab6a516 100644 --- a/test/js/third_party/nodemailer/process-nodemailer-fixture.js +++ b/test/js/third_party/nodemailer/process-nodemailer-fixture.js @@ -1,23 +1,20 @@ -import nodemailer from "nodemailer"; -const account = await nodemailer.createTestAccount(); +const nodemailer = require("nodemailer"); const transporter = nodemailer.createTransport({ - host: account.smtp.host, - port: account.smtp.port, - secure: account.smtp.secure, + host: "smtp.sendgrid.net", + port: 587, + secure: false, auth: { - user: account.user, // generated ethereal user - pass: account.pass, // generated ethereal password + 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: '"Fred Foo 👻" <foo@example.com>', // sender address - to: "example@gmail.com", // list of receivers + 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 }); -const url = nodemailer.getTestMessageUrl(info); -console.log(typeof url === "string" && url.length > 0); -transporter.close(); +console.log(typeof info?.messageId === "string"); |