diff --git a/packages/xo-server-backup-reports/src/index.js b/packages/xo-server-backup-reports/src/index.js index f762a3f69f8..3a7f42c8087 100644 --- a/packages/xo-server-backup-reports/src/index.js +++ b/packages/xo-server-backup-reports/src/index.js @@ -203,11 +203,13 @@ class BackupReportsXoPlugin { throw new Error(`Unknown backup job type: ${job.type}`) } - async _metadataHandler(log, { name: jobName }, schedule, force) { + async _metadataHandler(log, { name: jobName, settings }, schedule, force) { const xo = this._xo const formatDate = createDateFormatter(schedule?.timezone) + const mailReceivers = get(() => settings[''].reportRecipients) + const tasksByStatus = groupBy(log.tasks, 'status') if (!force && log.data.reportWhen === 'failure') { @@ -232,9 +234,9 @@ class BackupReportsXoPlugin { } return this._sendReport({ - ...(await templatesTransform.markdown(templates.markdown.metadata(context))), - ...(await templatesTransform.mjml(templates.mjml.metadata(context))), - subject: templates.mjml.metadataSubject(context), + subject: compiledMetadataSubject(context), + mailReceivers, + markdown: compiledMetadataTemplate(context), success: log.status === 'success', }) }