diff --git a/dashboard/src/views/email.html b/dashboard/src/views/email.html index 443e8bc1d..c0904de8c 100644 --- a/dashboard/src/views/email.html +++ b/dashboard/src/views/email.html @@ -136,6 +136,7 @@ {{ user.username }} +

{{ user.error }}

diff --git a/dashboard/src/views/email.js b/dashboard/src/views/email.js index 687d806c0..76d38b73b 100644 --- a/dashboard/src/views/email.js +++ b/dashboard/src/views/email.js @@ -90,13 +90,19 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio submit: function (user) { user.busy = true; + user.error =''; var aliases = user.aliases.split(',').map(function (a) { return a.trim(); }).filter(function (a) { return !!a; }); function done(error) { user.busy = false; - if (error) { + if (error && error.statusCode === 409) { + var alias = error.message.match(RegExp('\'(.*)-' + $scope.selectedDomain.domain + '\''))[1]; + user.error = alias + '@' + $scope.selectedDomain.domain + ' already exists'; + console.log('clearly hit', user.error) + return; + } else if (error) { console.error('Unable to configure mailbox.', error); return; }