Commit Graph

5 Commits

Author SHA1 Message Date
Lukas Wagner
abb06e4ebd notifications: test: style fixup
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>
2025-04-04 20:25:46 +02:00
Lukas Wagner
a70240a32b notification: replication: add common properties to template data
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>
2025-04-04 20:25:46 +02:00
Lukas Wagner
82fc0f6cdf notifications: apt: clean up notification template
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>
2025-04-04 20:25:46 +02:00
Lukas Wagner
5577f9da2d notification templates: vzdump: generate HTML table in template
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>
2025-04-04 20:25:46 +02:00
Lukas Wagner
fede7e87e4 notifications: use named templates instead of in-code templates
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>
2024-06-03 14:16:35 +02:00