Gathering detailed insights and metrics for feathers-mailer
Gathering detailed insights and metrics for feathers-mailer
Gathering detailed insights and metrics for feathers-mailer
Gathering detailed insights and metrics for feathers-mailer
npm install feathers-mailer
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
83 Stars
60 Commits
16 Forks
6 Watching
1 Branches
16 Contributors
Updated on 25 May 2024
Minified
Minified + Gzipped
TypeScript (52.43%)
JavaScript (47.57%)
Cumulative downloads
Total Downloads
Last day
-53.4%
348
Compared to previous day
Last week
-15.3%
3,415
Compared to previous week
Last month
-13.2%
16,900
Compared to previous month
Last year
-47.3%
212,732
Compared to previous year
Feathers mailer service using
nodemailer
1npm install feathers-mailer --save
If using a transport plugin, install the respective module.
1const mailer = require('feathers-mailer');
app.use('/emails', mailer(transport, defaults))
transport
can be either SMTP options or a transport plugin with associated options.defaults
is an object that defines default values for mail options.service.create(body, params)
service.create
is a thin wrapper for transporter.sendMail
, accepting body
and returning a promise.
See here for possible fields of body
.
1const mailer = require('feathers-mailer'); 2const nodemailer = require('nodemailer'); 3 4(async function (app) { 5 const account = await nodemailer.createTestAccount(); // internet required 6 7 const transporter = { 8 host: account.smtp.host, 9 port: account.smtp.port, 10 secure: account.smtp.secure, // 487 only 11 requireTLS: true, 12 auth: { 13 user: account.user, // generated ethereal user 14 pass: account.pass // generated ethereal password 15 } 16 }; 17 18 // Register service and setting default From Email 19 app.use('mailer', mailer(transporter, { from: account.user })); 20 21 // Use the service 22 const email = { 23 to: 'president@mars.com', 24 subject: 'SMTP test', 25 html: 'This is the email body' 26 }; 27 28 await app.service('mailer').create(email) 29 console.log(`Preview URL: ${nodemailer.getTestMessageUrl(info)}`) 30})(app)
1const mailer = require('feathers-mailer'); 2const mandrill = require('nodemailer-mandrill-transport'); 3 4// Register the service, see below for an example 5app.use('/mailer', mailer(mandrill({ 6 auth: { 7 apiKey: process.env.MANDRILL_API_KEY 8 } 9}))); 10 11// Use the service 12const email = { 13 from: 'FROM_EMAIL', 14 to: 'TO_EMAIL', 15 subject: 'Mandrill test', 16 html: 'This is the email body' 17}; 18 19app.service('mailer').create(email).then(function (result) { 20 console.log('Sent email', result); 21}).catch(err => { 22 console.log(err); 23});
Copyright (c) 2018
Licensed under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 5/24 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
13 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More