mod/notification-email: introduce $PurgeEmailQueue

... to purge the queue and remove the scheduler.
This commit is contained in:
Christian Hesse 2023-08-06 16:25:06 +02:00
parent 5b789d298b
commit 9a5d55da0d
2 changed files with 14 additions and 0 deletions

View file

@ -64,6 +64,11 @@ Place this before you call them:
:global SendEMail; :global SendEMail;
:global SendNotification; :global SendNotification;
In case there is a situation when the queue needs to be purged there is a
function available:
$PurgeEMailQueue;
See also See also
-------- --------

View file

@ -10,6 +10,7 @@
:global LogForwardFilterLogForwarding; :global LogForwardFilterLogForwarding;
:global NotificationEMailSubject; :global NotificationEMailSubject;
:global NotificationFunctions; :global NotificationFunctions;
:global PurgeEMailQueue;
:global QuotedPrintable; :global QuotedPrintable;
:global SendEMail; :global SendEMail;
:global SendEMail2; :global SendEMail2;
@ -156,6 +157,14 @@
} }
} }
# purge the e-mail queue
:set PurgeEMailQueue do={
:global EmailQueue;
/system/scheduler/remove [ find where name="\$FlushEmailQueue" ];
:set EmailQueue;
}
# convert string to quoted-printable # convert string to quoted-printable
:global QuotedPrintable do={ :global QuotedPrintable do={
:local Input [ :tostr $1 ]; :local Input [ :tostr $1 ];