Integration with Mailchimp
What You'll Need
Backend
var request = require("request");
module.exports.endpoint = function(req, cb){
var options = {
method: 'POST',url:
'https://us12.api.mailchimp.com/3.0/campaigns/[campaign_id]/actions/test',
headers: {
content_type: 'application/json'
},
auth:{
username:'username',
password: 'api_key'
},
body: {
test_emails: [ 'TO Mail' ],
send_type: 'html'
},
json: true
};
request(options, function (error, response, body) {
if (error) {
cb({res:error})
}
console.log(body);
cb({d:body});
});
}; Last updated