There are three template files,
vzdump-body.html.hbs
,
vzdump-body.txt.hbs
and
vzdump-subject.txt.hbs
. The subject template is used for the subject for the email. The backup notification mail is sent as a multi-part message, containing a plaintext part (
vzdump-body.txt.hbs
) and an HTML part (
vzdump-body.html.hbs
). If the HTML template file does not exist, the plaintext template is used for both the plaintext part and the HTML part.
Regarding variables, there is not really much more available than what is used at the moment in the existing templates. See [1] for which data is passed to the rendering engine.
The templates are based on Handlebars templates [2], refer to [3] for a syntax reference.
The following helper functions are available for our notification templates:
{{ human-byte <data> }}
renders a byte value to humanly readable form (e.g. 1.4GiB)
{{ duration <data> }}
format a duration (e.g. number of seconds to 1h 4m 10s)
{{ timestamp <data> }}
format a Unix timestamp
{{ table <data> }}
render a table. The data that is passed must conform to the expected schema (e.g see [4] for an example)
{{ object <data> }}
format the passed data as pretty-printed JSON
The templates and helpers are still somewhat of an implementation detail and might change once we add the override mechanism.
Then we might add additional variables or helpers.
I hope this helps. Let me know if you have any further specific questions. Also let me know if you have any wishes or suggestions for what additional variables/helpers you could need, we will consider them when adding the override mechanism.
[1]
https://git.proxmox.com/?p=pve-mana...e002a6268eec456d055c9ef42f79eb8e;hb=HEAD#l531
[2]
https://docs.rs/handlebars/latest/handlebars/
[3]
https://handlebarsjs.com/
[4]
https://git.proxmox.com/?p=proxmox....18b027018f0d13532404b205e3dc6366;hb=HEAD#l101