【发布时间】:2019-03-05 03:53:20
【问题描述】:
谁能给我一个工作示例代码?我使用 NodeJS v6.14.4 下面是我的伪代码。
我是 NodeJS 的新手。如果有人可以提供一个工作示例代码,以至少从节点 JS 发送 SES 电子邮件作为可重用的用户函数,那就太好了。
我希望以这种方式构建我的 NodeJS 代码: --------------index.js------------------ 初始化 aws 库。
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.
}
【问题讨论】:
标签: node.js amazon-web-services aws-lambda amazon-sqs amazon-ses