Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 1.16 KB

README.md

File metadata and controls

54 lines (42 loc) · 1.16 KB

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'
//      ]
//    }
// }