Pepipost SDK for NodeJS
This SDK was semi-automatically generated by APIMATIC v2.0. Thanks to APIMATIC
Installation
npm install pepipost-sdk-nodejs
Usage
create a file example.js and put the below code
example.js
var PepipostSDK = require('pepipost-sdk-nodejs');
var Email = PepipostSDK.EmailController;
var data = {
"api_key": "yoursecretapikey",
"email_details": {
"fromname": "yourfromname",
"subject": "this is test email subject",
"from": "from@example.com",
"content": "<p> hi, this is a test email sent via Pepipost JSON API.</p>"
},
"recipients": [
"recipient@example.com"
]
};
Email.send(data,callback_mail_sent);
function callback_mail_sent(err_msg,parsed,context){
if(parsed.errorcode==0){
console.log("mail sent successfully.\n");
}
else{
console.log("Email sent Failed.\n");
console.log("errormessage("+parsed.errormessage+")\n");
console.log("errorcode("+parsed.errorcode+")\n");
}
}
Change the "yoursecretkey" with your API key and example.com with your approved domain name. To get your api key you need to signup/register on Pepipost
nodejs example.js