Skip to content

Commit

Permalink
Ensure we have a subject
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
mwhouser committed Apr 4, 2016
1 parent 7ee2c5e commit 3a178bc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion SendSesEmail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ exports.handler = function (event, context) {
if (event.name == null) {
event.name = event.email;
}


// Make sure we have a subject.
// If the event didn't include it, then
// pull it from the configuration.
// If we still don't have a subject, then
// just make one up.
if (event.subject == null) {
event.subject = config.defaultSubject;

if (event.subject == null) {
event.subject = "Mail from {{name}}";
}
}

console.log('Loading template from ' + config.templateKey + ' in ' + config.templateBucket);
Expand Down

0 comments on commit 3a178bc

Please sign in to comment.