turiy-email
v1.3.1
Published
This package is built on nodemailer.
Downloads
11
Maintainers
Readme
Turiy Email Package
This package is built on nodemailer
and mjml
. The functions exported here is treated as server side functions. This package is able to create connection with your email host and send-email on behalf programatically.
Recommended to use inside
server components
oruse server
files.
Sending email with sendMail
function
await sendMail(
//Sender email secrets
{
host: "google.com", //Your email host
port: 465, //Port number
emailId: "[email protected]", //Your email-id
password: "P%^&D&fa78q2%^$%$&*()*^&%", //Your email password
label: "Mr. Company 💖", //Label that will be shown beside your email-id
},
//Receiver email-ids
['[email protected]', '[email protected]', '[email protected]',...],
//Email subject
"This is a test mail subject",
//Email body; it might also be created with emailTemplate(...)
'This is a test mail body'
);
Creating email template
Example: Double column responsive email template
emailHtml({
bgColor: "#ffff00",
widthPx: 600,
sections: [
{
bgColor: "#ffffff",
columns: [
{
widthPercent: 50,
child: [
<div style={{ color: "#000000", fontSize: "20px" }}>
Hello World
</div>,
],
},
{
widthPercent: 50,
child: [
<div style={{ color: "#000000", fontSize: "20px" }}>
Hello World
</div>,
],
},
],
},
],
});