diff --git a/packages/xo-server-transport-email/src/index.js b/packages/xo-server-transport-email/src/index.js index fb425abee..2e8255d4c 100644 --- a/packages/xo-server-transport-email/src/index.js +++ b/packages/xo-server-transport-email/src/index.js @@ -93,6 +93,20 @@ export const configurationSchema = { required: ['from', 'transport'] } +export const testSchema = { + type: 'object', + + properties: { + to: { + type: 'string', + description: 'recipient of the test mail' + } + }, + + additionalProperties: false, + required: ['to'] +} + // =================================================================== class TransportEmailPlugin { @@ -141,6 +155,16 @@ class TransportEmailPlugin { this._unset() } + test ({to}) { + return this._sendEmail({ + to, + subject: '[Xen Orchestra] Test of transport-email plugin', + markdown: `Hi there, + +The transport-email plugin for Xen Orchestra server seems to be working fine, nicely done :)` + }) + } + _sendEmail ({ from = this._conf.from, to, cc, bcc,