
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Emails module for Mono
npm install --save mono-mail
Then, in your configuration file of your Mono application (example: conf/application.js
):
module.exports = {
mono: {
modules: ['mono-mail']
}
}
mono-mail
will use the mono.mail
property of your configuration (example: conf/development.js
):
module.exports = {
mono: {
mail: {
exposeRoutes: true, // enabled by default on development environment
provider: { // not required
name: 'smtp || ses',
... //conf of the provider
},
from: 'mono-mail@mono.io', //sender email adress (required)
smtp: // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/924fafffc09cfeb0267573af2c847cdbfcfa464d/types/nodemailer-smtp-transport/index.d.ts#L47
}
}
}
Mono mail is currently supporting two providers to send your email:
If no provider is provided the library will remove the /mails/send
route and the send method.
Mono mail is a mono module that using mjml and handlebar to generate and send awesome mails.
const monoMail = require('mono-mail')
Mono mail also expose some methods as REST routes
TODO: All rest calls need a session and a role that contain manageMail
action. This action is not added automatically.
The routes for preview and sending an email are only available on development environment or if the exposeRoutes
is set to true in the configuration of the module.
Run the mono server with mono-mail
NODE_ENV=test npx mono dev test/fixture/ok
Once the server launched go to this url
POST
routeMethod | URI | Query params | Body | Action |
---|---|---|---|---|
GET | /mails/preview | path , data , pathType | Return HTML Generated mail | |
POST | /mails/send | pathType | path , data , to , subject | Send email |
Query params:
pathType
?: String (relative
or absolute
) Relative from current mono instance dirnamePost/Query params:
path
: String. Path to the mail filedata
: Object. Data object that will be compiled by handlebarPost params:
subject
: String (compiled with handlebar). Subject of the mailto
: String. Email adress of the senderregisterPartial(partialName = String, partialPathmail = String): Promise<void>
Register new partial template to be used inside mail template
Arguments:
partialName
: String. Partial name keypartialPathmail
: String. Path of the partial template// Register new partial
const template = await monoMail.registerPartial('font-footer', join(__dirname, 'modules/mails/font-footer.html'))
generate(mail = { path, data, subject }): Promise<String>
Generate HTML template from mail object.
Arguments:
path
: String. Path to the mail filedata
: Object. Data object that will be compiled by handlebarsubject
: String (compiled with handlebar). Subject of the mail// Generate template mail in HTML
const template = await monoMail.generate({
subject: 'Hello, {{ firstName }}',
path: join(__dirname, 'modules/users/signup.html'),
data: {
title: 'Welcome to mono-mail',
description: 'Mono module using mjml and handlebar to generate awesome template mail and send it to your customers'
}
})
send(mail = { path, data, subject, bcc, to, attachments: [{ filename, path, contentType }] }): Promise<void>
Generate HTML template from mail object.
Arguments:
bcc
: String. Blind Carbon Copy emailto
: String. Recipient email addressattachments
: Array<{ filename, path, contentType }>. Attachment to the mail// Send email to recipient@terrajs.io recipient
const template = await monoMail.generate({
subject: 'Hello, {{ firstName }}',
path: join(__dirname, 'modules/users/signup.html'),
bcc: 'copy@terrajs.io',
to: 'recipient@terrajs.io',
data: {
title: 'Welcome to mono-mail',
description: 'Mono module using mjml and handlebar to generate awesome template mail and send it to your customers'
}
})
See the contribution guidelines of this project.
MIT © gaetansenn
FAQs
Mails module for Mono
The npm package mono-mail receives a total of 0 weekly downloads. As such, mono-mail popularity was classified as not popular.
We found that mono-mail demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.