sendcloud-client

0.3.1 • Public • Published

sendcloud-client

Build Status Coverage Status

Node.js client for http://sendcloud.sohu.com.

Support send mails in sync way.

Install

$ npm install sendcloud-client

Usage

Init

const SendCloud = require('sendcloud-client');
 
const client = new SendCloud({
  from: 'mail from',
  apiUser: 'your api user',
  apiKey: 'your api key'
});

Send

// send mail
const options = {
  to: [ 'baijuyi@gmail.com', 'lishangyin@qq.com' ],
  subject: '晚上来我家吃饭吧!',
  html: '老婆做了东坡肉,与大家一起分享!'
};
 
const res = yield client.send(options);
console.log(res);
// {
//    result: true,
//    statusCode: 200,
//    message: '请求成功',
//    info: {
//      emailIdList: [
//        '1426053463570_15_32087_2059.sc-10_10_127_105-inbound0$baijuyi@gmail.com',
//        '1426053463570_15_32087_2059.sc-10_10_127_105-inbound3$lishangyin@qq.com'
//      ]
//    }
// }

Readme

Keywords

Package Sidebar

Install

npm i sendcloud-client

Weekly Downloads

1

Version

0.3.1

License

MIT

Last publish

Collaborators

  • rockdai