Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
punch-emailer
Advanced tools
Send emails
see email-templates documentation https://github.com/niftylettuce/node-email-templates
<div>
Hello, <%= user.firstName + ' ' + user.lastName %>
Reset password link <a href="<%- verificationLink %>" target="_blank">link</a>
Or just copy the link: <%- verificationLink %>
</div>
'use strict';
const PunchEmailer = require('punch-emailer');
const path = require('path');
const smtpConfig = {
host: process.env.SMTP_HOST || 'xxxxx',
port: process.env.SMTP_PORT || 465,
secure: process.env.SMTP_SECURE || true, // use SSL
auth: {
user: process.env.SMTP_USER || 'xxxxx',
pass: process.env.SMTP_PASS || 'xxxxx'
}
};
const HOST = process.env.HOST || ' http://xxxxx.com/';
const querystring = require("querystring");
const templateDir = path.join(__dirname, 'templates');
const config = {
from: process.env.SMTP_FROM || 'no-reply@xxxxx.com',
templateDir: templateDir,
nodemailerConf : smtpConfig
};
class Emailer extends PunchEmailer {
sendEmailVerification(to, data){
let queryParams = querystring.stringify({email : to, code : data.verificationCode});
data.verificationLink = HOST + '#/confirm-email?' + queryParams;
return this.sendTemplate(
to,
'Email verification',
'email-verification',
data
);
};
sendResetPassword(to, data){
let queryParams = querystring.stringify({email : to, code : data.verificationCode});
data.verificationLink = HOST + '#/reset-password?' + queryParams;
return this.sendTemplate(
to,
'Reset password',
'reset-password',
data
);
};
};
module.exports = new Emailer(config);
const emailer = require('./emailer');
emailer.sendEmailVerification('test@te.st', {
user : {
firstName : 'Jastin',
lastName : 'Hastin'
},
verificationCode : 'xxx-xxx-xxxx'
})
FAQs
Module for send emails based on nodemailer.
We found that punch-emailer 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.