* [pbs-devel] [PATCH proxmox-backup] docs: notifications: add section about how to use custom templates
@ 2025-04-09 8:11 Lukas Wagner
2025-04-09 8:15 ` Alexander Zeidler
2025-04-09 8:47 ` [pbs-devel] superseded: " Lukas Wagner
0 siblings, 2 replies; 3+ messages in thread
From: Lukas Wagner @ 2025-04-09 8:11 UTC (permalink / raw)
To: pbs-devel
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 <l.wagner@proxmox.com>
---
docs/notifications.rst | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/docs/notifications.rst b/docs/notifications.rst
index 34fc0128..7cd4d229 100644
--- a/docs/notifications.rst
+++ b/docs/notifications.rst
@@ -362,3 +362,25 @@ 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
+``<type>-<body|subject>.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.
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pbs-devel] [PATCH proxmox-backup] docs: notifications: add section about how to use custom templates
2025-04-09 8:11 [pbs-devel] [PATCH proxmox-backup] docs: notifications: add section about how to use custom templates Lukas Wagner
@ 2025-04-09 8:15 ` Alexander Zeidler
2025-04-09 8:47 ` [pbs-devel] superseded: " Lukas Wagner
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Zeidler @ 2025-04-09 8:15 UTC (permalink / raw)
To: Proxmox Backup Server development discussion
On Wed Apr 9, 2025 at 10:11 AM CEST, Lukas Wagner wrote:
> 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 <l.wagner@proxmox.com>
Reviewed-by: Alexander Zeidler <a.zeidler@proxmox.com>
> ---
> docs/notifications.rst | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/docs/notifications.rst b/docs/notifications.rst
> index 34fc0128..7cd4d229 100644
> --- a/docs/notifications.rst
> +++ b/docs/notifications.rst
> @@ -362,3 +362,25 @@ 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
> +``<type>-<body|subject>.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.
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pbs-devel] superseded: [PATCH proxmox-backup] docs: notifications: add section about how to use custom templates
2025-04-09 8:11 [pbs-devel] [PATCH proxmox-backup] docs: notifications: add section about how to use custom templates Lukas Wagner
2025-04-09 8:15 ` Alexander Zeidler
@ 2025-04-09 8:47 ` Lukas Wagner
1 sibling, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2025-04-09 8:47 UTC (permalink / raw)
To: pbs-devel
Superseded-by: https://lore.proxmox.com/all/20250409084628.125951-1-l.wagner@proxmox.com/T/#t
--
- Lukas
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-09 8:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-09 8:11 [pbs-devel] [PATCH proxmox-backup] docs: notifications: add section about how to use custom templates Lukas Wagner
2025-04-09 8:15 ` Alexander Zeidler
2025-04-09 8:47 ` [pbs-devel] superseded: " Lukas Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal