New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hof-emailer

Package Overview
Dependencies
Maintainers
16
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hof-emailer

A service for generating and sending html and raw emails for use with HOF services

  • 2.1.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
16
Weekly downloads
 
Created
Source

HOF Emailer

An emailer service for HOF applications.

Installation

$ npm install hof-emailer --save

Usage

// first create an emailer instance
const Emailer = require('hof-emailer');
const emailer = new Emailer({
  from: 'sender@example.com',
  transport: 'smtp',
  transportOptions: {
    host: 'my.smtp.host',
    port: 25
  }
});

// then you can use your emailer to send emails
const to = 'recipient@example.com';
const body = 'This is the email body';
const subject = 'Important email!'
emailer.send(to, body, subject)
  .then(() => {
    console.log(`Email sent to ${to}!`);
  });

Options

  • from: : Address to send emails from. Required.
  • transport: : Select what mechanism to use to send emails. Defaults: 'smtp'.
  • transportOptions: : Set the options for the chosen transport, as defined below. Required.
  • layout: : Optional path to use a custom layout for email content.
  • Transports

    The following transport options are available:

    smtp

    nodemailer-smtp-transport

    Options
    • host : Address of the mailserver. Required.
    • port <String|Number>: Port of the mailserver. Required.
    • ignoreTLS : Defaults to false.
    • secure : Defaults to true.
    • auth.user : Mailserver authorisation username.
    • auth.pass : Mailserver authorisation password.

    ses

    nodemailer-ses-transport

    Options
    • accessKeyId : AWS accessKeyId. Required.
    • secretAccessKey : AWS accessKeyId. Required.
    • sessionToken
    • region . Defaults to 'eu-west-1'.
    • httpOptions
    • rateLimit
    • maxConnections

    debug

    A development option to write the html content of the email to a file for inspection.

    transport: 'debug'

    debug options
    • dir : The location to save html to. Default: ./.emails. This directory will be created if it does not exist.
    • open : If set to true, will automatically open the created html file in a browser.
    debug example
    transport: 'debug'
    transportOptions: {
      dir: './emails',
      open: true
    }
    

    stub

    Disables sending email. No options are required.

FAQs

Package last updated on 13 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc