diff --git a/src/translation/en.json b/src/translation/en.json index 5f9d93185..cb2e8bef9 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -1200,7 +1200,9 @@ "title": "Mail FROM Address", "description": "This sets the address from which this app sends email. This app is already configured to send mail using {{ domain }}'s Outbound Email settings.", "mailboxPlaceholder": "Leave empty to use platform default", - "saveAction": "Save" + "saveAction": "Save", + "enable": "Send emails using the internal mail server", + "description2": "When enabled, the app is configured to send emails via the internal mail server using this address. The internal mail server will use the {{ domain }}'s Outbound Email settings to send mail. When disabled, you can configure the email settings within the app." }, "csp": { "title": "Content Security Policy" diff --git a/src/views/app.html b/src/views/app.html index 2f7f139e7..ae375aae1 100644 --- a/src/views/app.html +++ b/src/views/app.html @@ -851,31 +851,35 @@
- -

+ + +

- -
-
{{ email.error.mailboxName }}
+
+
+
{{ email.error.mailboxName }}
-
- +
+ -
- - +
+ + +
+
-
-
+
diff --git a/src/views/app.js b/src/views/app.js index 5efd0972a..5241c27c3 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -749,6 +749,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' busy: false, error: {}, + enableMailbox: true, mailboxName: '', mailboxDomain: '', currentMailboxName: '', @@ -759,6 +760,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.emailForm.$setPristine(); $scope.email.error = {}; + $scope.email.enableMailbox = app.enableMailbox; $scope.email.mailboxName = app.mailboxName || ''; $scope.email.mailboxDomain = $scope.domains.filter(function (d) { return d.domain === app.mailboxDomain; })[0]; $scope.email.currentMailboxName = app.mailboxName || ''; @@ -769,7 +771,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.email.error = {}; $scope.email.busy = true; - Client.configureApp($scope.app.id, 'mailbox', { mailboxName: $scope.email.mailboxName || null, mailboxDomain: $scope.email.mailboxDomain.domain }, function (error) { + Client.configureApp($scope.app.id, 'mailbox', { enable: $scope.email.enableMailbox, 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; @@ -784,6 +786,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' if (error) return Client.error(error); // when the mailboxName is 'reset', this will fill it up with the default again + $scope.email.enableMailbox = $scope.app.enableMailbox; $scope.email.mailboxName = $scope.app.mailboxName || ''; $scope.email.mailboxDomain = $scope.domains.filter(function (d) { return d.domain === $scope.app.mailboxDomain; })[0]; $scope.email.currentMailboxName = $scope.app.mailboxName || '';