email domain can be selected
This commit is contained in:
+9
-4
@@ -609,7 +609,7 @@
|
||||
<div class="task-active-overlay" ng-show="app.taskId"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label class="control-label" for="emailMailboxNameEnabled">Custom Mail FROM</label>
|
||||
<label class="control-label" for="emailMailboxNameEnabled">Mail FROM Address</label>
|
||||
<p>This sets the address from which this app sends email. This app is already configured to send mail using {{app.domain}}'s <a ng-href="/#/email/{{ app.domain }}">Outbound Email</a> settings.</p>
|
||||
|
||||
<fieldset>
|
||||
@@ -622,12 +622,17 @@
|
||||
<input type="text" class="form-control" name="mailboxName" placeholder="Leave empty to use platform default" ng-model="email.mailboxName">
|
||||
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" ng-disabled="!email.mailboxNameEnabled">
|
||||
@{{ email.domain.domain }}
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span>{{ email.mailboxDomain.domain }}</span>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right" role="menu">
|
||||
<li ng-repeat="domain in domains">
|
||||
<a href="" ng-click="email.mailboxDomain = domain">{{ domain.domain }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
</div>
|
||||
<input class="ng-hide" type="submit" ng-disabled="!emailForm.$dirty || email.busy"/>
|
||||
|
||||
+4
-3
@@ -451,7 +451,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
error: {},
|
||||
|
||||
mailboxName: '',
|
||||
domain: '',
|
||||
mailboxDomain: '',
|
||||
|
||||
show: function () {
|
||||
var app = $scope.app;
|
||||
@@ -459,14 +459,14 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
$scope.emailForm.$setPristine();
|
||||
$scope.email.error = {};
|
||||
$scope.email.mailboxName = app.mailboxName || '';
|
||||
$scope.email.domain = $scope.domains.filter(function (d) { return d.domain === app.domain; })[0];
|
||||
$scope.email.mailboxDomain = $scope.domains.filter(function (d) { return d.domain === app.mailboxDomain; })[0];
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
$scope.email.error = {};
|
||||
$scope.email.busy = true;
|
||||
|
||||
Client.configureApp($scope.app.id, 'mailbox', { mailboxName: $scope.email.mailboxName || null }, function (error) {
|
||||
Client.configureApp($scope.app.id, 'mailbox', { mailboxName: $scope.email.mailboxName || null, mailboxDomain: $scope.email.mailboxDomain.domain }, function (error) {
|
||||
if (error && error.statusCode === 400) {
|
||||
$scope.email.busy = false;
|
||||
$scope.email.error.mailboxName = error.message;
|
||||
@@ -483,6 +483,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
if (error) return;
|
||||
// when the mailboxName is 'reset', this will fill it up with the default again
|
||||
$scope.email.mailboxName = $scope.app.mailboxName || '';
|
||||
$scope.email.mailboxDomain = $scope.domains.filter(function (d) { return d.domain === $scope.app.mailboxDomain; })[0];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user