cleverreach-wrapper
v0.4.6
Published
Wrapper for the CleverReach REST API
Downloads
5
Readme
cleverreach-wrapper
Promise based npm module for using CleverReach REST API
Install
$ npm install --save cleverreach-wrapper
Usage
var CleverReach = require('cleverreach-wrapper');
// Login credentials
var cr = new CleverReach({
client_id: '123456',
login: '[email protected]',
password: 'abc123'
});
// Get all mailings
cr.mailings().getAll().then(function(mailings) {
console.log(mailings);
});
// Get single mailing with specified ID
cr.mailings().get(1234567).then(function(mailing) {
console.log(mailing);
}).catch(function(error) {
console.log(error);
})
// Create new mailing
var newMailing = {
'mailingData': {
'name': 'This is the title',
'type': 'html/text',
'subject': 'subject line',
'sender_name': 'Bruce Whayne (Whayne corp.)',
'sender_email': '[email protected]',
'group_id': '#',
'html': 'Newsletter Content',
'text': 'this is the Text only'
}
};
cr.mailings().create(newMailing).then(function(mailing) {
console.log(mailing)
});
API
You find detailed infos about the CleverReach REST API here
Here is a list of all implemented functions: