From cee29c5772c0f0df05fbc6deba9eae620edc4cda Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 13 Mar 2018 11:43:24 +0100 Subject: generate-mirror-mail.pl: Add multi-issue template Signed-off-by: Florian Pritz --- bin/generate-mirror-mail.pl | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/bin/generate-mirror-mail.pl b/bin/generate-mirror-mail.pl index 4b31eb6..83142f5 100755 --- a/bin/generate-mirror-mail.pl +++ b/bin/generate-mirror-mail.pl @@ -58,6 +58,23 @@ please check what\'s going on? {$mirror_url} {$connection_failed{mirror_urls}} +Thanks, +{$mail_from_name} +', + }, + 'multiple-issues' => { + 'subject' => '[{$mirror_name}] Multiple issues with your Arch Linux mirror', + 'template' => 'Hi, + +We are seeing multiple issues with your Arch Linux mirror {$mirror_name} +{$mirror_url} + +- We are unable to reach your mirror{$OUT = " via ".join(", ", @{$connection_failed{protocols}}) if @{$connection_failed{protocols}} > 0;}: +{$connection_failed{mirror_urls}} + +- Your mirror seems to be out of sync since {$out_of_sync{last_sync}}: +{$out_of_sync{mirror_urls}} + Thanks, {$mail_from_name} ', @@ -186,12 +203,13 @@ while () { } - if (@out_of_sync) { + if (@out_of_sync and @connection_failed) { + send_template_mail($to, $templates{"multiple-issues"}{"subject"}, $templates{"multiple-issues"}{"template"}, \%values); + $sent_mail = 1; + } elsif (@out_of_sync) { send_template_mail($to, $templates{"out-of-sync"}{"subject"}, $templates{"out-of-sync"}{"template"}, \%values); $sent_mail = 1; - } - - if (@connection_failed) { + } elsif (@connection_failed) { send_template_mail($to, $templates{"connection-failed"}{"subject"}, $templates{"connection-failed"}{"template"}, \%values); $sent_mail = 1; } -- cgit v1.2.3-24-g4f1b