From d2560db5c96b5e2679178fd4f6595af89cab0801 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 29 Apr 2021 16:26:31 +0200 Subject: email-backup: use $SendEMail2 This drops $EmailBackupTo & $EmailBackupCc from settings! Use settings overwrite if required: :global EmailGeneralToOverride { "email-backup"="backup@example.com"; } --- email-backup | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'email-backup') diff --git a/email-backup b/email-backup index e9a75cd..0ba4d45 100644 --- a/email-backup +++ b/email-backup @@ -15,8 +15,6 @@ :global BackupSendBinary; :global BackupSendExport; :global Domain; -:global EmailBackupCc; -:global EmailBackupTo; :global Identity; :global CharacterReplace; @@ -25,6 +23,7 @@ :global MkDir; :global RandomDelay; :global ScriptFromTerminal; +:global SendEMail2; :global WaitForFile; :global WaitFullyConnected; @@ -33,10 +32,6 @@ $LogPrintExit2 error $0 ("Configured to send neither backup nor config export.") true; } -:if ([ :len $EmailBackupTo ] = 0) do={ - $LogPrintExit2 error $0 ("Configuration is missing recipient for e-mail backup.") true; -} - $WaitFullyConnected; :if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={ @@ -71,11 +66,11 @@ $WaitFullyConnected; } # send email with status and files -/ tool e-mail send to=$EmailBackupTo cc=$EmailBackupCc \ - subject=("[" . $Identity . "] Backup & Config") \ - body=("See attached files for backup and config export for " . \ - $Identity . ".\n\n" . \ - [ $DeviceInfo ] . "\n\n" . \ - "Backup file: " . $BackupFile . "\n" . \ - "Config file: " . $ConfigFile) \ - file=$Attach; +$SendEMail2 ({ origin=$0; \ + subject=("Backup & Config"); \ + message=("See attached files for backup and config export for " . \ + $Identity . ".\n\n" . \ + [ $DeviceInfo ] . "\n\n" . \ + "Backup file: " . $BackupFile . "\n" . \ + "Config file: " . $ConfigFile); \ + attach=$Attach }); -- cgit v1.2.3-70-g09d2