mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Better error messages if the "Send Test Email" button fails.
This commit is contained in:
@@ -31,14 +31,21 @@ Discourse.AdminEmailIndexController = Discourse.Controller.extend({
|
||||
@method sendTestEmail
|
||||
**/
|
||||
sendTestEmail: function() {
|
||||
this.set('sentTestEmail', false);
|
||||
this.setProperties({
|
||||
sendingEmail: true,
|
||||
sentTestEmail: false
|
||||
});
|
||||
|
||||
var adminEmailLogsController = this;
|
||||
var self = this;
|
||||
Discourse.ajax("/admin/email/test", {
|
||||
type: 'POST',
|
||||
data: { email_address: this.get('testEmailAddress') }
|
||||
}).then(function () {
|
||||
adminEmailLogsController.set('sentTestEmail', true);
|
||||
self.set('sentTestEmail', true);
|
||||
}).catch(function () {
|
||||
bootbox.alert(I18n.t('admin.email.test_error'));
|
||||
}).finally(function() {
|
||||
self.set('sendingEmail', false);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user