server: sync email notification: adapt template for local sync jobs

Add a guard clause that checks `job.remote`, otherwise the template
fails to render to to handlebars being configured in strict mode.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2023-11-29 17:35:12 +01:00 committed by Thomas Lamprecht
parent ca8cf67187
commit 6ef0238f99

View File

@ -90,11 +90,14 @@ Please visit the web interface for further details:
const SYNC_OK_TEMPLATE: &str = r###"
Job ID: {{job.id}}
Datastore: {{job.store}}
Remote: {{job.remote}}
Remote Store: {{job.remote-store}}
Job ID: {{job.id}}
Datastore: {{job.store}}
{{#if job.remote~}}
Remote: {{job.remote}}
Remote Store: {{job.remote-store}}
{{else~}}
Local Source Store: {{job.remote-store}}
{{/if}}
Synchronization successful.
@ -106,11 +109,14 @@ Please visit the web interface for further details:
const SYNC_ERR_TEMPLATE: &str = r###"
Job ID: {{job.id}}
Datastore: {{job.store}}
Remote: {{job.remote}}
Remote Store: {{job.remote-store}}
Job ID: {{job.id}}
Datastore: {{job.store}}
{{#if job.remote~}}
Remote: {{job.remote}}
Remote Store: {{job.remote-store}}
{{else~}}
Local Source Store: {{job.remote-store}}
{{/if}}
Synchronization failed: {{error}}