Skip to content

Instantly share code, notes, and snippets.

@sendpulse
Last active March 18, 2022 20:59
Show Gist options
  • Save sendpulse/01a58073f94b34a87eef to your computer and use it in GitHub Desktop.
Save sendpulse/01a58073f94b34a87eef to your computer and use it in GitHub Desktop.
SendPulse REST API Usage Example for Node.js (https://sendpulse.com/api)
// SendPulse's Node.JS Library: https://github.com/sendpulse/sendpulse-rest-api-node.js
var sendpulse = require("./api/sendpulse.js");
sendpulse.init(API_USER_ID,API_SECRET,TOKEN_STORAGE);
var email = {
"html" : "<p>Your email content goes here</p>",
"text" : "Your email text version goes here",
"subject" : "Testing SendPulse API",
"from" : {
"name" : "Your Sender Name",
"email" : "[email protected]"
},
"to" : [ {
"name" : "Subscriber's name",
"email" : "[email protected]"
} ]
};
var answerGetter = function answerGetter(data){
console.log(data);
}
sendpulse.smtpSendMail(answerGetter,email);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment