Can someone give me a working example code? I use NodeJS v6.14.4 Below is my pseudo code.
I am new to NodeJS. If someone can provide a working sample code to at least send out SES email from a node JS as a reusable user function then that would be great.
I am looking to structure my NodeJS code like this manner: --------------index.js----------------------------- initialize aws library.
exports.handler = function(event, context) {
// Read the invoking SQS queue.
var queueType = getQueueType(SQL_URL);
// Send customer welcome email for Reseller Type ='RS'
if(queueType == 'RS') {
SendSESEmailRS(params);
}
// Send customer welcome email for Reseller Type ='EY'
if(queueType == 'EY') {
SendSESEmailEY(params);
}
}
function SendSESEmailRS(params){
// code to send out SES Email
}
function SendSESEmailEY(params){
// code to send out SES Email
}
// Get the Reseller type from the invoking queue.
function getQueueType(params){
// code to retrieve the Reseller shortForm from the SQS queue which is invoking this Lambda Function.
}