]> git.proxmox.com Git - pve-manager.git/commit - PVE/API2/VZDump.pm
vzdump: send notifications via new notification module
authorLukas Wagner <l.wagner@proxmox.com>
Thu, 3 Aug 2023 12:16:52 +0000 (14:16 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 16 Aug 2023 09:10:10 +0000 (11:10 +0200)
commitc4afde55f2f9091644dd2e7cff8c069f59bb4215
tree3e0f4ae9e55df46be4ec65831c278785d3f531e9
parent7c236b5c11b0c1c020aa4735319e62f7f01bbbd4
vzdump: send notifications via new notification module

... instead of using sendmail directly.

If the new 'notification-target' parameter is set,
we send the notification to this endpoint or group.
If 'mailto' is set, we add a temporary endpoint and a
temporary group containg both targets.

This commit also refactors the old 'sendmail' sub heavily:
  - Use template-based notification text instead of endless
    string concatenations
  - Removing the old plaintext/HTML table rendering in favor of
    the new template/property-based approach offered by the
    `proxmox-notify` crate.
  - Rename `sendmail` sub to `send_notification`
  - Breaking out some of the code into helper subs, hopefully
    reducing the spaghetti factor a bit

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
PVE/API2/VZDump.pm
PVE/VZDump.pm
test/mail_test.pl