Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
nodemailer-mjml-mustache
Advanced tools
A plugin for nodemailer that uses mjml and mustache view engine to generate emails.
A plugin for nodemailer that uses mjml and mustache view engine to generate emails.
npm install nodemailer-mjml-mustache --save
viewPath
(required) provides the path to the directory where your views aretemplate
the name of the template file to use without the extensioncontext
this will be passed to the view engine as the context data to render the variables with.// example
context: {
name: `Bob Ross`,
url: `https://mjml.io/try-it-live`,
}
<!-- MJML Example-->
<mj-text>Hello {{name}}, <a href="{{url}}">Click here</a></mj-text>
let nodemailer = require(`nodemailer`)
let mjml = require(`../lib`)
let htmlToText = require(`nodemailer-html-to-text`).htmlToText
// Setup local version of mailcatcher
let transporter = nodemailer.createTransport({
host: '127.0.0.1',
port: 1025,
})
// Compile the mjml template to html with parsing the mustache variables
transporter.use(`compile`, mjml({
viewPath: `${__dirname}/views`
}))
// Convert the html to text to populate the text email part
transporter.use(`compile`, htmlToText())
// Setup test send options
const options = {
context: {
name: `Bob Ross`,
url: `https://mjml.io/try-it-live`,
},
from: `from@email.com`,
to: `to@email.com`,
subject: `Verify your email address`,
template: `example`,
}
console.log("Sending options", options)
// Send the email
new Promise((resolve, reject) => {
transporter.sendMail(options, function(error, info){
if (error) {
return reject(error)
}
resolve(info)
})
})
FAQs
A plugin for nodemailer that uses mjml and mustache view engine to generate emails.
We found that nodemailer-mjml-mustache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.