
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
hof-behaviour-emailer
Advanced tools
HOF behaviour to send emails
const EmailBehaviour = require('hof-behaviour-emailer');
// configure email behaviour
const emailer = EmailBehaviour({
transport: 'ses',
transportOptions: {
accessKeyId: '...',
secretAccessKey: '...'
},
template: path.resolve(__dirname, './views/emails/confirm.html'),
from: 'confirmation@homeoffice.gov.uk',
recipient: 'customer-email',
subject: 'Application Successful'
});
// in steps config
steps: {
...
'/confirm': {
behaviours: ['complete', emailer],
next: '/confirmation',
...
},
...
}
In addition to the options passed to hof-emailer
, the following options can be used:
recipient
- Required - defines the address to which email will be sent. This can be set either as a key to retrieve an email address from the session, or explicitly to an email address.template
- Required - defines the mustache template used to render the email content.subject
- defines the subject line of the email.parse
- parses the session model into an object used to populate the template.recipient
and subject
options can also be defined as functions, which will be passed a copy of the session model and a translation function as arguments, and should return a string value.
// use a translated value for the email subject line
const emailer = EmailBehaviour({
// ...
subject: (model, translate) => translate('email.success.subject')
});
FAQs
HOF behaviour to send emails
The npm package hof-behaviour-emailer receives a total of 9 weekly downloads. As such, hof-behaviour-emailer popularity was classified as not popular.
We found that hof-behaviour-emailer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.