fix(xo-server-backup-reports): fix No recipients defined error (#4998)

Correctly fall back to plugin recipients if `mailRecipients` is empty.
This commit is contained in:
badrAZ
2020-05-19 14:22:24 +02:00
committed by GitHub
parent 6cf211a9ad
commit d649211330
2 changed files with 7 additions and 7 deletions
@@ -667,13 +667,11 @@ class BackupReportsXoPlugin {
})
}
_sendReport({
mailReceivers = this._mailsReceivers,
markdown,
nagiosMarkdown,
subject,
success,
}) {
_sendReport({ mailReceivers, markdown, nagiosMarkdown, subject, success }) {
if (mailReceivers === undefined || mailReceivers.length === 0) {
mailReceivers = this._mailsReceivers
}
const xo = this._xo
return Promise.all([
xo.sendEmail !== undefined &&