test email now requires a domain
This commit is contained in:
@@ -1125,12 +1125,12 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.sentTestMail = function (email, callback) {
|
||||
Client.prototype.sendTestMail = function (domain, to, callback) {
|
||||
var data = {
|
||||
email: email
|
||||
to: to
|
||||
};
|
||||
|
||||
post('/api/v1/cloudron/send_test_mail', data).success(function(data, status) {
|
||||
post('/api/v1/cloudron/' + domain + '/send_test_mail', data).success(function(data, status) {
|
||||
if (status !== 202) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
<fieldset>
|
||||
<p class="has-error text-center" ng-show="testEmail.error">{{ testEmail.error.generic }}</p>
|
||||
|
||||
<p>This will send a test email from no-reply@{{domain}} to the below email address.</p>
|
||||
|
||||
<div class="form-group" ng-class="{ 'has-error': testEmail.error.key }">
|
||||
<label class="control-label" for="inputTestEmailKey">Email to</label>
|
||||
<input type="text" class="form-control" ng-model="testEmail.mailTo" id="inputTestMailTo" name="mailTo" ng-disabled="testEmail.busy" placeholder="Email address" autofocus>
|
||||
|
||||
@@ -169,6 +169,8 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
|
||||
mailTo: '',
|
||||
|
||||
domain: null,
|
||||
|
||||
clearForm: function () {
|
||||
$scope.testEmail.mailTo = '';
|
||||
},
|
||||
@@ -177,6 +179,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
$scope.testEmail.error = {};
|
||||
$scope.testEmail.busy = false;
|
||||
|
||||
$scope.testEmail.domain = $scope.selectedDomain;
|
||||
$scope.testEmail.mailTo = $scope.user.email;
|
||||
|
||||
$('#testEmailModal').modal('show');
|
||||
@@ -186,7 +189,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
$scope.testEmail.error = {};
|
||||
$scope.testEmail.busy = true;
|
||||
|
||||
Client.sentTestMail($scope.testEmail.mailTo, function (error) {
|
||||
Client.sendTestEmail($scope.selectedDomain.domain, $scope.testEmail.mailTo, function (error) {
|
||||
$scope.testEmail.busy = false;
|
||||
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user