Added tag in report e-mail

This commit is contained in:
Pierre 2016-03-17 12:11:49 +01:00
parent 4095d6dcf6
commit 5e3831a1a4

View File

@ -120,6 +120,7 @@ class BackupReportsXoPlugin {
const start = moment(status.start)
const end = moment(status.end)
const duration = moment.duration(end - start).humanize()
const tag = status.calls[status.start].params.tag
if (reportWhen === 'fail' && globalStatus === 'Success') {
return
@ -127,7 +128,7 @@ class BackupReportsXoPlugin {
// Global status.
text.unshift([
`## Global status: ${globalStatus}`,
`## Global status for "${tag}": ${globalStatus}`,
` - Start time: ${String(start)}`,
` - End time: ${String(end)}`,
` - Duration: ${duration}`,
@ -142,7 +143,7 @@ class BackupReportsXoPlugin {
if (this._xo.sendEmail) {
await this._xo.sendEmail({
to: this._mailsReceivers,
subject: 'Backup Reports (XenOrchestra)',
subject: `Backup Reports for "${tag}" (XenOrchestra)`,
markdown
})
}