Coder Social home page Coder Social logo

lyuzashi / node-ses-any-promise Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haoliangyu/node-ses-any-promise

0.0 1.0 0.0 68 KB

An Amazon SES api for nodejs with your favorite promise library

License: MIT License

Makefile 0.57% JavaScript 99.43%

node-ses-any-promise's Introduction

node-ses-any-promise

This is a fork of node-ses with any-promise support. No feature is added or removed.

All functions that require callback function in the original project now return a promise:

// register your favorite promise library, default would be the native global promise
require('any-promise/register/bluebird');

var ses = require('node-ses-any-promise');
var client = ses.createClient({ key: 'key', secret: 'secret' });

// Give SES the details and let it construct the message for you.
client.sendEmail({
  to: '[email protected]',
  from: '[email protected]',
  cc: '[email protected]',
  bcc: ['[email protected]', '[email protected]'],
  subject: 'greetings',
  message: 'your <b>message</b> goes here',
  altText: 'plain text'
};
.then(function(data, res) {
  // do something
})
.catch(function(err) {
  // do something
});

// ... or build a message from scratch yourself and send it.
client.sendRawEmail({
  from: '[email protected]',
  rawMessage: rawMessage
})
.then(function(data, res) {
  // do something
})
.catch(function(err) {
  // do something
});

For more detial, see the documentation of node-ses and any-promise.

Licence

MIT

node-ses-any-promise's People

Contributors

aheckmann avatar brozeph avatar cellule avatar cromestant avatar jessetane avatar markstos avatar robludwig avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.