0.0.3 • Published 11 years ago
sp-email-extended v0.0.3
It is java script thrift client which connects to communication thrift service using TFrameProtocol.
To install sp-email, use npm:
$ npm install sp-email
Below is the list of other configurable options.
var communicationServiceConfig = { host: "localhost", port: 28002 }
Example
var email = require("sp-email");
Minimum options required to use it are enable, directory and fileName;
var logger = log.create({
host: "localhost",
port: 28002});
Sending email using sp-email
var eMailModuleObj = require("../sp-email.js");
/*Data model is data the*/
var dataModelStr = JSON.stringify({
"username": "neerajsi@flipkart.com",
"loginLink":"http://localhost:4000/dashboard#settings",
"termsAndConditionsLink":"",
"feeAndBillingLink":""
});
var paramsJson = {
"senderEmailId": "noreply@flipkart.com",
"senderName": "Test Platform",
"receiverEmailId": "neerajsi@flipkart.com",
"receiverName": "Neeraj Singh",
"toList":[],
"bccList":[],
"ccList":[],
"templateId":"createAccountTmp",
"clientName":"createAccount",
"modelStr":dataModelStr
};
function handleSendMail(error, responseMessage) {
if (error) {
console.log(error);
} else {
console.log(responseMessage);
}
}
var eMailModule = eMailModuleObj.create({
host: "thrift_email_server",
port: 25358
});
eMailModule.sendMail(paramsJson, handleSendMail);