sp-email-extended

"Sends email and sms using \"communication thrift service\"."

**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 }

 
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(errorresponseMessage) {
    if (error) {
        console.log(error);
    } else {
        console.log(responseMessage);
    }
}
 
 
var eMailModule = eMailModuleObj.create({
                                            host: "thrift_email_server",
                                            port: 25358
                                        });
eMailModule.sendMail(paramsJson, handleSendMail);