Wrapper for sending emails with AWS SES supporting templates

Usage no npm install needed!

<script type="module">
  import sesEmailClient from '';


SES Email Client

js-semistandard-style Build Status semantic-release


ses-email-client is a wrapper for sending emails with AWS SES supporting templates.

Supported Templates

  • mjml
  • handlebars
  • ejs


npm i ses-email-client


Instantiate Client

All settings are optional

// or ES6 syntax import SESEmailClient from 'ses-email-client';
const SESEmailClient = require('ses-email-client');
const client = new SESEmailClient({
    accessKeyId: '**********',
    secretAccessKey: '**********',
    region: 'eu-west-2',
    templateLanguage: 'handlebars', // 'mjml', 'ejs'
    production: true, // or process.env.NODE_ENV = production is as setting to true
    tmpltCacheSize: 50, // template cache size default = 100
    attCacheSize: 50 // attachment cache size default = 100

Note that in production mode either by explicitly setting it to true or by setting NODE_ENV = production ses-email-client will cache template and attachment files.

For AWS you can skip providing credentials as the aws-sdk is used so you can opt for other ways for authorizing.

For more info you can check setting-credentials-node.

Send an email

await client.send({
    from: '',
    to: '',
    subject: 'Hello World',
    text: 'Hello World',

Message options

  • from string
  • to string or string []
  • cc string or string []
  • bcc string or string []
  • text string
  • html string
  • subject string
  • template string the path of the html template you want to use
  • data object an object containing the data that the template is going to be compiled with
  • subject string
  • attachments
        "name": "myfilte.txt", // optional if not provided will keep filename
        "path": __dirname + "/path/to/file"
// or 
[__dirname + "/path/to/file","another/file"]



You can also check an example usage.


For any issues.


MIT License