diff --git a/src/views/email.html b/src/views/email.html
index 731bd98c5..ebc01a55b 100644
--- a/src/views/email.html
+++ b/src/views/email.html
@@ -6,18 +6,26 @@
-
- No DNS provider is setup. The DNS records listed below have to be setup manually.
-
-
- Cloudron will setup Email related DNS records automatically for {{selectedDomain.domain}}. Status of DNS Records below
- may show an error while DNS is propagating (~5 minutes).
-
- If this domain is already configured to handle email with some other provider, it will overwrite those records.
+
+
+ No DNS provider is setup. The DNS records listed below have to be setup manually.
+
+
+ Cloudron will setup Email related DNS records automatically for {{selectedDomain.domain}}. Status of DNS Records below
+ may show an error while DNS is propagating (~5 minutes).
+
+ If this domain is already configured to handle email with some other provider, it will overwrite those records.
+
+
+
+ The Cloudron Email Server is only part of the paid subscription.
+
+
diff --git a/src/views/email.js b/src/views/email.js
index bbdc8ef87..77a479e98 100644
--- a/src/views/email.js
+++ b/src/views/email.js
@@ -10,7 +10,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
$scope.client = Client;
$scope.user = Client.getUserInfo();
$scope.config = Client.getConfig();
-
+ $scope.hasSubscription = false;
$scope.domains = [];
$scope.users = [];
$scope.selectedDomain = null;
@@ -192,10 +192,25 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
if ($scope.selectedDomain.mailConfig.enabled) {
$('#disableEmailModal').modal('show');
} else {
- $('#enableEmailModal').modal('show');
+ Client.getAppstoreConfig(function (error, appstoreConfig) {
+ if (error) return console.error(error);
+ if (!appstoreConfig.token) return;
+
+ AppStore.getSubscription(appstoreConfig, function (error, result) {
+ if (error) return console.error(error);
+
+ $scope.hasSubscription = result.plan.id !== 'free';
+
+ $('#enableEmailModal').modal('show');
+ });
+ });
}
};
+ $scope.closeEnableEmailDialog = function () {
+ $('#enableEmailModal').modal('hide');
+ };
+
$scope.enableEmail = function () {
$('#enableEmailModal').modal('hide');