SendPulse REST API Usage Example for Node.js (https://sendpulse.com/api)

mewcrow
2022-03-18T20:59:51Z

sample.js

| // 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" : " Your email content goes here ",
| "text" : "Your email text version goes here",
| "subject" : "Testing SendPulse API",
| "from" : {
| "name" : "Your Sender Name",
| "email" : "your-sender-email@gmail.com"
| },
| "to" : [ {
| "name" : "Subscriber's name",
| "email" : "subscriber@gmail.com"
| } ]
| };
| var answerGetter = function answerGetter(data){
| console.log(data);
| }
| sendpulse.smtpSendMail(answerGetter,email);