0.4.3 • Published 6 years ago
cleverreach v0.4.3
cleverreach
Promise based npm module for using CleverReach REST API
Install
$ npm install --save cleverreach
Usage
var CleverReach = require('cleverreach');
// Login credentials
var cr = new CleverReach({
client_id: '123456',
login: 'john.doe@foo.bar',
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': 'bruce.whayne@gotham.com',
'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: