Remove the email subscription requirement

This commit is contained in:
Girish Ramakrishnan
2018-06-11 10:30:02 -07:00
parent e741ca9216
commit af9652f7c8
2 changed files with 2 additions and 21 deletions
-7
View File
@@ -16,17 +16,10 @@
<br/><br/>
If this domain is already configured to handle email with some other provider, it will overwrite those records.
</div>
<div ng-hide="hasSubscription">
<br/>
<div class="text-danger">
A paid subscription is required to enable the Email Solution.
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success" ng-show="hasSubscription" ng-click="enableEmail()">I understand, enable</button>
<a class="btn btn-success" ng-hide="hasSubscription" ng-click="closeEnableEmailDialog()" ng-href="{{ config.webServerOrigin + '/console.html#/userprofile?view=subscriptions&email=' + appstoreConfig.profile.emailEncoded + '&cloudronId=' + appstoreConfig.cloudronId }}" target="_blank">Setup Subscription</a>
</div>
</div>
</div>
+2 -14
View File
@@ -2,7 +2,7 @@
/* global asyncForEach:false */
angular.module('Application').controller('EmailController', ['$scope', '$location', '$timeout', '$rootScope', 'Client', 'AppStore', function ($scope, $location, $timeout, $rootScope, Client, AppStore) {
angular.module('Application').controller('EmailController', ['$scope', '$location', '$timeout', '$rootScope', 'Client', function ($scope, $location, $timeout, $rootScope, Client) {
Client.onReady(function () { if (!Client.hasScope('mail')) $location.path('/'); });
$scope.ready = false;
@@ -10,7 +10,6 @@ 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;
@@ -196,18 +195,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
if ($scope.selectedDomain.mailConfig.enabled) {
$('#disableEmailModal').modal('show');
} else {
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');
});
});
$('#enableEmailModal').modal('show');
}
};