Could you explain how you attempted to override the template (e.g. which files did you use?)
I made new versions of
vzdump-body.html.hbs
,
vzdump-body.txt.hbs
and
vzdump-subject.txt.hbs
. I've also got an eml file that I can provide showing what I've been sent. Thinking about it after checking what I've got in the gmail client and what I have in the eml file, I'm really not sure if it's actually just showing me the text version of the message for some reason and excluding the html one, although that does appear in the eml file so it is bieng sent.
vzdump-subject.txt.hbs
My change to this file was simply to re-order the subject line to show the node first:
HTML:
({{fqdn}}) vzdump backup status: {{status-text}}
vzdump-body.html.hbs
My change to this file was to improve readability by:
- Adding a summary section at the top (status, node, date, duration, size)
- Replacing the default table with one that includes:
- Borders around each cell using inline `style="border: 1px solid"` rules
- Colored rows for each guest entry based on status:
- Green for "Okay" (status = `ok`)
- Red for "Failed" (status = `err`)
- Yellow for "Skipped" (anything else)
- Each `<td>` element has a `background-color` applied inline (since `<tr>` styling didn’t work in my mail client)
- Status labels are shown as "Okay", "Failed", or "Skipped" to improve alignment and clarity
HTML:
<html>
<body>
{{error}}
<h1 style="font-size: 1.2em">Backup Summary</h1>
<p><strong>Status:</strong> {{summary-status}}</p>
<p><strong>Node:</strong> {{node}}</p>
<p><strong>Mode:</strong> {{mode}}</p>
<p><strong>Date:</strong> {{timestamp}}</p>
<p><strong>Total Time:</strong> {{duration total-time}}<br/>
<strong>Total Size:</strong> {{human-bytes total-size}}</p>
<h2 style="font-size: 1.1em">Details</h2>
<table style="border-collapse: collapse; width: 100%;">
<tr>
<th style="border: 1px solid #000; padding: 4px;">VMID</th>
<th style="border: 1px solid #000; padding: 4px;">Name</th>
<th style="border: 1px solid #000; padding: 4px;">Status</th>
<th style="border: 1px solid #000; padding: 4px;">Time</th>
<th style="border: 1px solid #000; padding: 4px;">Size</th>
<th style="border: 1px solid #000; padding: 4px;">Filename</th>
</tr>
{{#each guest-table.data}}
<tr>
<td style="border: 1px solid #000; padding: 4px;
{{#if (eq this.status "ok")}}background-color: #e6f4ea;
{{else if (eq this.status "err")}}background-color: #fce8e6;
{{else}}background-color: #fff8e1;
{{/if}}">{{this.vmid}}</td>
<td style="border: 1px solid #000; padding: 4px;
{{#if (eq this.status "ok")}}background-color: #e6f4ea;
{{else if (eq this.status "err")}}background-color: #fce8e6;
{{else}}background-color: #fff8e1;
{{/if}}">{{this.name}}</td>
<td style="border: 1px solid #000; padding: 4px;
{{#if (eq this.status "ok")}}background-color: #e6f4ea;
{{else if (eq this.status "err")}}background-color: #fce8e6;
{{else}}background-color: #fff8e1;
{{/if}}">
{{#if (eq this.status "ok")}}Okay
{{else if (eq this.status "err")}}Failed
{{else}}Skipped{{/if}}
</td>
<td style="border: 1px solid #000; padding: 4px;
{{#if (eq this.status "ok")}}background-color: #e6f4ea;
{{else if (eq this.status "err")}}background-color: #fce8e6;
{{else}}background-color: #fff8e1;
{{/if}}">{{this.time}}</td>
<td style="border: 1px solid #000; padding: 4px;
{{#if (eq this.status "ok")}}background-color: #e6f4ea;
{{else if (eq this.status "err")}}background-color: #fce8e6;
{{else}}background-color: #fff8e1;
{{/if}}">{{this.size}}</td>
<td style="border: 1px solid #000; padding: 4px;
{{#if (eq this.status "ok")}}background-color: #e6f4ea;
{{else if (eq this.status "err")}}background-color: #fce8e6;
{{else}}background-color: #fff8e1;
{{/if}}">{{this.filename}}</td>
</tr>
{{/each}}
</table>
<h2 style="font-size: 1.1em">Logs</h2>
<pre>{{logs}}</pre>
</body>
</html>
vzdump-body.txt.hbs
My change to this file was to reformat the plain-text message for both readability and better parsing in Home Assistant:
- A summary section is shown first (status, node, mode, date, total time, total size)
- A clearly formatted table follows using fixed-width columns:
Code:
{{#if error}}{{error}}
{{/if}} Proxmox Backup Summary - {{summary-status}}
Node: {{node}}
Backup Mode: {{mode}}
Date: {{timestamp}}
Total time: {{duration total-time}}
Total size: {{human-bytes total-size}}
VMID | Name | Status | Duration | Size | Filename
------------------------------------------------------------------
{{#each guest-table.data}}
{{this.vmid}} | {{this.name}} | {{#if (eq this.status "ok")}}Okay{{else if (eq this.status "err")}}Failed{{else}}Skipped{{/if}} | {{this.time}} | {{this.size}} | {{this.filename}}
{{/each}}
{{#if logs}}
Logs
====
{{logs}}
{{/if}}
Edit during writting
Okay, So I downlaoded Thunderbird and read the email using that and the table does partialy render properly, It's missing the colour styling for some reason. I'm thinking Gmail does somehting silly to remove the formating, whhich is weird becuase other emails I receive with custom styling work fine.