Instantiate the ses client if explicitly specified.

This allows end-users to use AWS features such as instance roles,
avoiding the use of explicit crendentials
This commit is contained in:
Shane Kilkelly 2017-06-21 10:57:13 +01:00
parent 2dda430691
commit 1112a1f085

View file

@ -18,7 +18,7 @@ client =
logger.log options:options, "Would send email if enabled."
callback()
if Settings?.email?.parameters?.AWSAccessKeyID?
if Settings?.email?.parameters?.AWSAccessKeyID? or Settings?.email?.driver == 'ses'
logger.log "using aws ses for email"
nm_client = nodemailer.createTransport(sesTransport(Settings.email.parameters))
else if Settings?.email?.parameters?.sendgridApiKey?