proxmox/proxmox-notify/src/endpoints
Lukas Wagner 1516cc26d2 notify: switch to file-based templating system
Instead of passing the template strings for subject and body when
constructing a notification, we pass only the name of a template.
When rendering the template, the name of the template is used to find
corresponding template files. For PVE, they are located at
/usr/share/proxmox-ve/templates/default. The `default` part is
the 'template namespace', which is a preparation for user-customizable
and/or translatable notifications.

Previously, the same template string was used to render HTML and
plaintext notifications. This was achieved by providing some template
helpers that 'abstract away' HTML/plaintext formatting. However,
in hindsight this turned out to be pretty finicky. Since the
current changes lay the foundations for user-customizable notification
templates, I ripped these abstractions out. Now there are simply two
templates, one for plaintext, one for HTML.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
2024-04-23 23:06:52 +02:00
..
common notify: add 'smtp' endpoint 2023-11-17 08:31:36 +01:00
gotify.rs notify: switch to file-based templating system 2024-04-23 23:06:52 +02:00
mod.rs notify: add 'smtp' endpoint 2023-11-17 08:31:36 +01:00
sendmail.rs notify: switch to file-based templating system 2024-04-23 23:06:52 +02:00
smtp.rs notify: switch to file-based templating system 2024-04-23 23:06:52 +02:00