From d25ec96c21abb2ec219d854e683953f9a4eb3909 Mon Sep 17 00:00:00 2001 From: Lukas Wagner Date: Wed, 9 Apr 2025 10:46:26 +0200 Subject: [PATCH] docs: notifications: add section about how to use custom templates This section is meant to give a basic overview on how to use custom templates for notifications. It will be expanded in the future, providing a more detailed view on how templates are resolved, existing fallback mechanisms, available templates, template variables and helpers. Signed-off-by: Lukas Wagner Reviewed-by: Alexander Zeidler Link: https://lore.proxmox.com/20250409084628.125951-1-l.wagner@proxmox.com --- docs/notifications.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/notifications.rst b/docs/notifications.rst index 34fc0128..2781dc1e 100644 --- a/docs/notifications.rst +++ b/docs/notifications.rst @@ -362,3 +362,23 @@ type via the ``notify`` option. The ``notify-user`` and ``notify`` options are ignored if ``notification-mode`` is set to ``notification-system``. + +Overriding Notification Templates +--------------------------------- + +Proxmox Backup Server uses Handlebars templates to render notifications. The +original templates provided by Proxmox Backup Server are stored in +``/usr/share/proxmox-backup/templates/default/``. + +Notification templates can be overridden by providing a custom template file in +the override directory at +``/etc/proxmox-backup/notification-templates/default/``. When rendering a +notification of a given type, Proxmox Backup Server will first attempt to load +a template from the override directory. If this one does not exist or fails to +render, the original template will be used. + +The template files follow the naming convention of +``-.txt.hbs``. For instance, the file +``gc-err-body.txt.hbs`` contains the template for rendering notifications for +garbage collection errors, while ``package-updates-subject.txt.hbs`` is used to +render the subject line of notifications for available package updates.