pronto-email-service

0.3.0 • Public • Published

Pronto Email Service

For sending emails. Currently supports AWS SES and SendGrid.

API

Exposes a single method sendEmail(email, cb).

Email fields are defined in the MailComposer documentation, most importantly you will need to and from addresses, a subject, and a text and/or html body.

email = {
    "to": "Test Jones <test@jones.net>",
    "from": "Example Sender <sender@example.com>",
    "subject": "Hi I am an email",
    "html": "<h1>HELLO</h1><p>Just testing, carry on now.</p>"
}

Setup

Initialize the email service with a config object, declaring and configuring one of the available providers.

ProntoEmailService = require 'pronto-email-service'
{sendEmail} = ProntoEmailService(config)

AWS SES config

Note: Region and access keys may be defined by environment variables (e.g. for a Lambda service).

config = {
    "provider": "ses",
    "region": "us-east-1",
    "accessKeyId": "abc123",
    "secretAccessKey": "def456"
}

SendGrid config

config = {
    "provider": "sendgrid",
    "api_key": "def456"
}

Readme

Keywords

none

Package Sidebar

Install

npm i pronto-email-service

Weekly Downloads

6

Version

0.3.0

License

none

Unpacked Size

3.92 kB

Total Files

11

Last publish

Collaborators

  • brynwaldwick
  • chadlieberman
  • spro