commented old code
This commit is contained in:
@ -247,51 +247,51 @@ exports.SendEmail_NewShifts = async function (publisher, shifts) {
|
|||||||
// };
|
// };
|
||||||
|
|
||||||
|
|
||||||
// https://mailtrap.io/blog/sending-emails-with-nodemailer/
|
// // https://mailtrap.io/blog/sending-emails-with-nodemailer/
|
||||||
exports.SendEmail_Example = async function (to) {
|
// exports.SendEmail_Example = async function (to) {
|
||||||
const welcomeImage = fs.readFileSync(
|
// const welcomeImage = fs.readFileSync(
|
||||||
path.join(CON.contentPath, "welcome.png")
|
// path.join(CON.contentPath, "welcome.png")
|
||||||
);
|
// );
|
||||||
|
|
||||||
await client
|
// await client
|
||||||
.send({
|
// .send({
|
||||||
category: "test",
|
// category: "test",
|
||||||
custom_variables: {
|
// custom_variables: {
|
||||||
hello: "world",
|
// hello: "world",
|
||||||
year: 2022,
|
// year: 2022,
|
||||||
anticipated: true,
|
// anticipated: true,
|
||||||
},
|
// },
|
||||||
from: sender,
|
// from: sender,
|
||||||
to: [{ email: to }],
|
// to: [{ email: to }],
|
||||||
subject: "Hello from Mailtrap!",
|
// subject: "Hello from Mailtrap!",
|
||||||
html: `<!doctype html>
|
// html: `<!doctype html>
|
||||||
<html>
|
// <html>
|
||||||
<head>
|
// <head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
// <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
</head>
|
// </head>
|
||||||
<body style="font-family: sans-serif;">
|
// <body style="font-family: sans-serif;">
|
||||||
<div style="display: block; margin: auto; max-width: 600px;" class="main">
|
// <div style="display: block; margin: auto; max-width: 600px;" class="main">
|
||||||
<h1 style="font-size: 18px; font-weight: bold; margin-top: 20px">Congrats for sending test email with Mailtrap!</h1>
|
// <h1 style="font-size: 18px; font-weight: bold; margin-top: 20px">Congrats for sending test email with Mailtrap!</h1>
|
||||||
<p>Inspect it using the tabs you see above and learn how this email can be improved.</p>
|
// <p>Inspect it using the tabs you see above and learn how this email can be improved.</p>
|
||||||
<img alt="Inspect with Tabs" src="cid:welcome.png" style="width: 100%;">
|
// <img alt="Inspect with Tabs" src="cid:welcome.png" style="width: 100%;">
|
||||||
<p>Now send your email using our fake SMTP server and integration of your choice!</p>
|
// <p>Now send your email using our fake SMTP server and integration of your choice!</p>
|
||||||
<p>Good luck! Hope it works.</p>
|
// <p>Good luck! Hope it works.</p>
|
||||||
</div>
|
// </div>
|
||||||
<!-- Example of invalid for email html/css, will be detected by Mailtrap: -->
|
// <!-- Example of invalid for email html/css, will be detected by Mailtrap: -->
|
||||||
<style>
|
// <style>
|
||||||
.main { background-color: white; }
|
// .main { background-color: white; }
|
||||||
a:hover { border-left-width: 1em; min-height: 2em; }
|
// a:hover { border-left-width: 1em; min-height: 2em; }
|
||||||
</style>
|
// </style>
|
||||||
</body>
|
// </body>
|
||||||
</html>`,
|
// </html>`,
|
||||||
attachments: [
|
// attachments: [
|
||||||
{
|
// {
|
||||||
filename: "welcome.png",
|
// filename: "welcome.png",
|
||||||
content_id: "welcome.png",
|
// content_id: "welcome.png",
|
||||||
disposition: "inline",
|
// disposition: "inline",
|
||||||
content: welcomeImage,
|
// content: welcomeImage,
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
})
|
// })
|
||||||
.then(console.log, console.error, setResult);
|
// .then(console.log, console.error, setResult);
|
||||||
};
|
// };
|
||||||
|
Reference in New Issue
Block a user