0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Merge pull request #3738 from felixrieseberg/iss3728

Error notification if send test mail returns 500
This commit is contained in:
Hannah Wolfe 2014-08-14 20:38:08 +01:00
commit 801ca568e4

View file

@ -50,9 +50,13 @@ var DebugController = Ember.Controller.extend(Ember.Evented, {
ic.ajax.request(this.get('ghostPaths.url').api('mail', 'test'), {
type: 'POST'
}).then(function () {
self.notifications.showSuccess('Check your email for the test message:');
}).catch(function (response) {
self.notifications.showErrors(response);
self.notifications.showSuccess('Check your email for the test message.');
}).catch(function (error) {
if (typeof error.jqXHR !== 'undefined') {
self.notifications.showAPIError(error);
} else {
self.notifications.showErrors(error);
}
});
}
}