Add action button to send test mail in global mail view

This commit is contained in:
Johannes Zellner
2020-02-12 14:51:06 +01:00
parent fa630a6cb5
commit e9d10d6f2f
4 changed files with 87 additions and 82 deletions

View File

@@ -501,47 +501,6 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
}
};
$scope.testEmail = {
busy: false,
error: {},
mailTo: '',
domain: null,
clearForm: function () {
$scope.testEmail.mailTo = '';
},
show: function () {
$scope.testEmail.error = {};
$scope.testEmail.busy = false;
$scope.testEmail.domain = $scope.domain;
$scope.testEmail.mailTo = $scope.user.email;
$('#testEmailModal').modal('show');
},
submit: function () {
$scope.testEmail.error = {};
$scope.testEmail.busy = true;
Client.sendTestMail($scope.domain.domain, $scope.testEmail.mailTo, function (error) {
$scope.testEmail.busy = false;
if (error) {
$scope.testEmail.error.generic = error.message;
console.error(error);
$('#inputTestMailTo').focus();
return;
}
$('#testEmailModal').modal('hide');
});
}
};
function resetDnsRecords() {
$scope.expectedDnsRecordsTypes.forEach(function (record) {
var type = record.value;
@@ -703,7 +662,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
});
// setup all the dialog focus handling
['testEmailModal', 'mailboxAddModal', 'mailboxEditModal', 'mailinglistEditModal', 'mailinglistAddModal'].forEach(function (id) {
['mailboxAddModal', 'mailboxEditModal', 'mailinglistEditModal', 'mailinglistAddModal'].forEach(function (id) {
$('#' + id).on('shown.bs.modal', function () {
$(this).find('[autofocus]:first').focus();
});