ac-ses
A helper tool to send emails via AWS SES. It also support "convenience" calls, to inform groups (e.g. support with informSupport function)
Last updated 22 days ago by mmpro .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ac-ses 
SYNC missed versions from official npm registry.

AC SES

A helper tool to send emails via AWS SES.
It also support "convenience" calls, to inform groups (e.g. support with informSupport function)

Usage

const acses = require('ac-ses')

// Min requirements
acses.init({ 
  aws: {
    accessKeyId: 'xxx',
    secretAccessKey: 'xxx',
    region: 'eu-central-1'  
  }
})

let email = {
    to: [{ 
      name: 'Jane Doe', // optional
      address: 'jane.doe@admiralcloud.com'
    }],
    from: {
      address: 'john.doe@admiralcloud.com',
      name: 'John Doe' // optional
    },
    replyTo: [{ // optional
      name: 'Jane Doe',
      address: 'jane.doe@admiralcloud.com'
    }],
    subject: 'This is my subject',
    text: 'This is my message', // optional if you send html. It is good practice to always send a text
    html: 'This is my <b>message</b>' // optional
}

acses.sendEmail(email, (err, result) => {
  console.log(err, result)
  // More infos regarding the result:
  // https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SES.html#sendEmail-property
})

Full setup

acses.init({ 
  aws: {
    accessKeyId: 'xxx',
    secretAccessKey: 'xxx',
    region: 'eu-central-1'  
  },
  redis: REDISINSTANCE,
  defaultBlockTime: BLOCKTIME FOR SAME MESSAGE,
  defaultSender: {
    address: 'defaultSender@admiralcloud.com',
    name: 'AdmiralCloud Sender'
  },
  securityRecipient: {
    address: 'defaultSecurityRecipient@admiralcloud.com',
    name: 'AdmiralCloud Security'
  },
  supportRecipient: {
    address:    address: 'defaultSupportRecipient@admiralcloud.com',
    name: 'AdmiralCloud Support'
  },
  environment: ENVIRONMENT // defaults to proces.env.NODE_ENV,
  useEnvironmentPrefixInSubject: TRUE|FALSE // defaults to TRUE - prefixes e-mail subject with environment to avoid confusion during development
})


Links

License

MIT License Copyright © 2009-present, AdmiralCloud, Mark Poepping

Current Tags

  • 1.2.0                                ...           latest (22 days ago)

11 Versions

  • 1.2.0                                ...           22 days ago
  • 1.1.10                                ...           6 months ago
  • 1.1.9                                ...           6 months ago
  • 1.1.8                                ...           9 months ago
  • 1.1.7                                ...           10 months ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 18
Dependencies (6)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |