eahefnawy / lambda-mailer Goto Github PK
View Code? Open in Web Editor NEW:envelope: AWS Lambda for sending emails. Ready for deployment in 60 seocnds.
:envelope: AWS Lambda for sending emails. Ready for deployment in 60 seocnds.
Hello,
I'm invoking the function from another lambda. The function is triggered, but the email doesn't succeed:
2017-04-25T00:06:57.273Z 13c6055f-294b-11e7-a972-e75138f1d5c4 TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:1211:7)
at Object.module.exports.run (/var/task/mailer.js:21:26)
at exports.handler (/var/task/index.js:6:10)
The invocation is done as this:
import * as aws from 'aws-sdk'
var lambda = new aws.Lambda();
var params = {
FunctionName: 'aws_lambda_mailer-dev',
InvocationType: 'RequestResponse',
LogType: 'Tail',
Payload: '{ test: test }'
};
lambda.invoke(params, function(err, data) {
if (err) {
context.fail(err);
console.log('Error sending message: ' + err);
} else {
context.succeed('Lambda message: '+ data.Payload);
console.log('Lambda message: ' + data.Payload);
}
})
And in the logs I only get information about an error:
2017-04-25T07:16:05.932Z 04548153-2987-11e7-ac80-8186ddeda411 Lambda message:
{
"errorMessage": "RequestId: 066b7a6c-2987-11e7-8954-c35459870107 Process exited before completing request"
}
Any idea about why the path might be undefined? When the function is invoked manually (via the test console) the path is found correctly.
Instead of using Nodemailer module and authenticating with SMPT credentials can we use SES and allow the IAM policy to allow SendEmail
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.