Skip to content

Commit

Permalink
optional smtp auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelitski committed Mar 1, 2016
1 parent 3fec18c commit aafeabb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/notifications/email.es6
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ export default class EmailTarget extends NotificationTarget {
assert(smtp.host);
assert(smtp.port);
assert(smtp.from);
assert(smtp.auth);
assert(smtp.auth.user);
assert(smtp.auth.password);

if (smtp.auth) {
assert(smtp.auth.user);
assert(smtp.auth.password);
}

this._recipients = recipients;
this._smtpSettings = smtp;
this._sender = promisifyAll(nodemailer.createTransport({
port: smtp.port,
host: smtp.host,
from: smtp.from,
auth: {
auth: smtp.auth && {
user: smtp.auth.user,
pass: smtp.auth.password
},
Expand Down

0 comments on commit aafeabb

Please sign in to comment.