diff --git a/docs/references/api.md b/docs/references/api.md index 9e0f0e10a..69c8b43f3 100644 --- a/docs/references/api.md +++ b/docs/references/api.md @@ -1200,6 +1200,37 @@ Sets the credentials used to configure DNS. This is currently internal API and is documented here for completeness. +### Get Email Configuration + +GET `/api/v1/settings/mail_config` admin internal + +Gets the email configuration. The Cloudron has a built-in email server for users. +This configuration can be used to disable the server. Note that the Cloudron will +always be able to send email on behalf of apps, regardless of this setting. + +Response(200): +``` +{ + "enable": // true to enable email +} +``` + +### Set Email Configuration + +POST `/api/v1/settings/mail_config` admin internal + +Sets the email configuration. The Cloudron has a built-in email server for users. +This configuration can be used to enable or disable the email server. Note that +the Cloudron will always be able to send email on behalf of apps, regardless of +this setting. + +Request: +``` +{ + "enable": +} +``` + ### Set fallback Certificate POST `/api/v1/settings/certificate` admin internal diff --git a/src/test/settings-test.js b/src/test/settings-test.js index 40b0e03f0..9fca9f690 100644 --- a/src/test/settings-test.js +++ b/src/test/settings-test.js @@ -153,6 +153,22 @@ describe('Settings', function () { }); }); + it('can set mail config', function (done) { + settings.setMailConfig({ prerelease: true }, function (error) { + expect(error).to.be(null); + done(); + }); + }); + + it('can get backup config', function (done) { + settings.getUpdateConfig(function (error, updateConfig) { + expect(error).to.be(null); + expect(updateConfig.prerelease).to.be(true); + done(); + }); + }); + + it('can get all values', function (done) { settings.getAll(function (error, allSettings) { expect(error).to.be(null);