Other commits introduced a consistent style for handlebars expressions,
this commit applies the same style to test notification templates.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
The new PVE::Notify::common_template_data helper gives us a hash of
properties which should be available in all notifications (hostname,
fqdn, cluster-name at this moment). This commit makes sure that
replication notifications have these available.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Clean up the notification templates to prepare for user-customizable
templates
- Change some of the template variable names to improve clarity
- Generate the table for available updates in the template itself,
not via the 'table' helper. This makes it possible for users
to change the style/structure of the table.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Instead of relying on the 'magic' table helper, we generate the guest
list in the vzdump HTML notification template using native Handlebars
syntax ({{#each}}). The template becomes a bit more ugly, mostly due to
HTML email's requirements to use inline CSS styling, but in the context
of providing user-customizable notification templates this is much
nicer. It gives the user a starting point for their modificiations
(custom styling, changing table formatting/order/etc.), which was not
possible before.
The plaintext template stays as is for now, mostly due to the fact that
the table helper automatically aligns table columns - something that
is not easily possible with native Handlebars syntax.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit adapts notification sending for
- package update
- replication
- backups
to use named templates (installed in /usr/share/pve-manager/templates)
instead of passing template strings defined in code to the
notification stack.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>