FEATURE: show exact error for test email

This commit is contained in:
Arpit Jalan
2014-11-19 21:19:12 +05:30
parent a211f542f5
commit c84b51d4ae
4 changed files with 13 additions and 5 deletions

View File

@ -36,8 +36,12 @@ export default DiscourseController.extend({
data: { email_address: this.get('testEmailAddress') }
}).then(function () {
self.set('sentTestEmail', true);
}).catch(function () {
bootbox.alert(I18n.t('admin.email.test_error'));
}, function(e) {
if (e.responseJSON && e.responseJSON.errors) {
bootbox.alert(I18n.t('admin.email.error', { server_error: e.responseJSON.errors[0] }));
} else {
bootbox.alert(I18n.t('admin.email.test_error'));
}
}).finally(function() {
self.set('sendingEmail', false);
});