Merge pull request #2137 from jgillich/patch-1

Don't require mail.options to be set
This commit is contained in:
Hannah Wolfe 2014-02-08 15:22:50 +00:00
commit 1783a895de

View File

@ -16,7 +16,7 @@ function GhostMailer(opts) {
// *This promise should always resolve to avoid halting Ghost::init*. // *This promise should always resolve to avoid halting Ghost::init*.
GhostMailer.prototype.init = function () { GhostMailer.prototype.init = function () {
var self = this; var self = this;
if (config().mail && config().mail.transport && config().mail.options) { if (config().mail && config().mail.transport) {
this.createTransport(); this.createTransport();
return when.resolve(); return when.resolve();
} }
@ -53,7 +53,7 @@ GhostMailer.prototype.detectSendmail = function () {
}; };
GhostMailer.prototype.createTransport = function () { GhostMailer.prototype.createTransport = function () {
this.transport = nodemailer.createTransport(config().mail.transport, _.clone(config().mail.options)); this.transport = nodemailer.createTransport(config().mail.transport, _.clone(config().mail.options) || {});
}; };
GhostMailer.prototype.usingSendmail = function () { GhostMailer.prototype.usingSendmail = function () {