Congrats for sending test email with Mailtrap!
Inspect it using the tabs you see above and learn how this email can be improved.

Now send your email using our fake SMTP server and integration of your choice!
Good luck! Hope it works.
// helper module to send emails with nodemailer const fs = require("fs"); const { MailtrapClient } = require("mailtrap"); const nodemailer = require("nodemailer"); const CON = require("./const"); const CAL = require("./calendar"); // const { google } = require("googleapis"); // const OAuth2 = google.auth.OAuth2; const { Shift, Publisher, PrismaClient } = require("@prisma/client"); const TOKEN = process.env.TOKEN || "a7d7147a530235029d74a4c2f228e6ad"; const SENDER_EMAIL = "pw@d-popov.com"; const sender = { name: "JW Cart: Shift Info", email: SENDER_EMAIL }; const client = new MailtrapClient({ token: TOKEN }); const mailtrapTestClient = new MailtrapClient({ username: '8ec69527ff2104',//not working now password: 'c7bc05f171c96c' }); // ------------------ Email sending ------------------ var lastResult = null; function setResult(result) { lastResult = result; } exports.GetLastResult = function () { return lastResult; }; exports.SendEmail = async function (to, subject, text, html) { const message = { from: sender, to, subject, text, html, }; }; exports.SendEmail_Test = async function (to, subject, text, html) { const message = { from: sender, to, subject, text, html, }; await mailtrapTestClient .send(message) .then(console.log, console.error, setResult); } // https://mailtrap.io/blog/sending-emails-with-nodemailer/ exports.SendTestEmail = async function (to) { // await client // .send({ // from: sender, // to: [{ email: RECIPIENT_EMAIL }], // subject: "Hello from Mailtrap!", // text: "Welcome to Mailtrap Sending!",Shift Info" // }) // .then(console.log, console.error, setResult); // return lastResult; const welcomeImage = fs.readFileSync( path.join(CON.contentPath, "welcome.png") ); await client .send({ category: "test", custom_variables: { hello: "world", year: 2022, anticipated: true, }, from: sender, to: [{ email: to }], subject: "Hello from Mailtrap!", html: `
Inspect it using the tabs you see above and learn how this email can be improved.
Now send your email using our fake SMTP server and integration of your choice!
Good luck! Hope it works.