npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chassis-email

v0.1.0

Published

Nodemailer wrapper for the Chassis bootstrapper

Downloads

2

Readme

Chassis Email

Nodemailer wrapper for the Chassis bootstrapper.


Getting Started

To install the plugin run:

npm install chassis-email

To enable the plugin, include the module in your code:

const Email = require("chassis-email");

Usage

Example:

let emailBody = {
    text: "This is email text.",
    html: "<p>This is email text with <b>HTML</b></p>"
}
let options = {
    cc: "[email protected]",
    replyTo: "[email protected]"
}

var myEmail = new Email("[email protected]", "[email protected]", emailBody, "myTransporter", options);

myEmail.send(function(myEmail) {
    if (myEmail.err) {
        //handle error
    } else {
        //email success
    }
});

Syntax

new Email(to, from, body, transporter, options);

Parameters

  • to (string) – Email address to send to.
  • from (string) – Email address sent from.
  • body (string|object) – Email body contents as a string or object.
  • body.text (string) – Plain text body of email. Optional
  • body.html (string) – HTML body of email. Optional
  • transporter (string) – Email transporter.
  • options (object) – Object of optional parameters. Optional

Options

  • cc (string|array) – Comma separated list or an array of recipients email addresses that will appear on the Cc: field. Optional
  • bcc (string|array) – Comma separated list or an array of recipients email addresses that will appear on the Bcc: field. Optional
  • attachments (array) – An array of attachment objects. Optional
  • sender (string) – An email address that will appear on the Sender: field (always prefer from if you’re not sure which one to use).
  • replyTo (string) – An email address that will appear on the Reply-To: field. Optional
  • inReplyTo (string) – The Message-ID this message is replying to. Optional
  • references (string|array) – Message-ID list. Optional
  • envelope (object) – SMTP envelope. Optional
  • attachDataUrls (boolean) – If true then convert data: images in the HTML content of this message to embedded attachments. Optional
  • watchHtml (object) – Apple Watch specific HTML version of the message. Latest watches have no problems rendering text/html content so watchHtml is most probably never seen by the recipient. Optional
  • amp (object) – AMP4EMAIL specific HTML version of the message, same usage as with text and html. Optional
  • icalEvent (object) – iCalendar event to use as an alternative. Optional
  • alternatives (object) – An array of alternative text contents (in addition to text and html parts). Optional
  • encoding (object) – Identifies encoding for text/html strings (defaults to ‘utf-8’, other values are ‘hex’ and ‘base64’). Optional
  • raw (object) – Existing MIME message to use instead of generating a new one. Optional
  • textEncoding (object) – Force content-transfer-encoding for text values (either quoted-printable or base64). By default the best option is detected (for lots of ascii use quoted-printable, otherwise base64). Optional
  • priority (object) – Sets message importance headers, either ‘high’, ‘normal’ (default) or ‘low’. Optional
  • headers (object) – An object or array of additional header fields (e.g. {“X-Key-Name”: “key value”} or [{key: “X-Key-Name”, value: “val1”}, {key: “X-Key-Name”, value: “val2”}]). Optional
  • messageId (object) – Message-Id value, random value will be generated if not set. Optional
  • date (object) – Date value, current UTC string will be used if not set. Optional
  • list (object) – Helper for setting List-* headers. Optional

Methods

  • 'send(callback)' – Sends email instance. Callback returns the email instance with the following additional parameters:
    • err (object) – Date value, current UTC string will be used if not set. Optional
    • info (object) – Date value, current UTC string will be used if not set. Optional
    • response (object) – Date value, current UTC string will be used if not set. Optional