diff --git a/app/assets/javascripts/discourse/controllers/preferences/email.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/email.js.es6 index c5edaef1991..50ee7857d2c 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/email.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/email.js.es6 @@ -34,8 +34,13 @@ export default ObjectController.extend({ this.set('saving', true); return this.get('content').changeEmail(this.get('newEmail')).then(function() { self.set('success', true); - }, function() { + }, function(data) { self.setProperties({ error: true, saving: false }); + if (data.responseJSON && data.responseJSON.errors && data.responseJSON.errors[0]) { + self.set('errorMessage', data.responseJSON.errors[0]); + } else { + self.set('errorMessage', I18n.t('user.change_email.error')); + } }); } } diff --git a/app/assets/javascripts/discourse/templates/user/email.js.handlebars b/app/assets/javascripts/discourse/templates/user/email.js.handlebars index 266d2afd384..8503485d140 100644 --- a/app/assets/javascripts/discourse/templates/user/email.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/email.js.handlebars @@ -17,7 +17,7 @@ {{#if error}}