Add Cloudron.setEmailEnabled

This commit is contained in:
Girish Ramakrishnan 2016-09-01 08:59:16 -07:00
parent 436533b887
commit d3d67df25f

View File

@ -420,6 +420,14 @@ Cloudron.prototype.migrate = function (options) {
if (options.domain) this._setDomain(options.domain);
};
Cloudron.prototype.setEmailEnabled = function (enabled) {
var res = request
.post(this._origin + '/api/v1/settings/mail_config').query({ access_token: this._credentials.accessToken })
.send({ enabled: enabled })
.end();
common.verifyResponse2xx(res, 'Could not enable email');
};
Cloudron.prototype.checkTimeZone = function (tz) {
var res = request.get(this._origin + '/api/v1/settings/time_zone').query({ access_token: this._credentials.accessToken }).end();
common.verifyResponse2xx(res, 'Could not query timezone');