This patch adds a simple hook to the process_message_queue cronjob
to allow plugins to pre-process messages in the messaging queue before
they are sent.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
cronlogaction();
+if ( C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins") ) {
+ my @plugins = Koha::Plugins->new->GetPlugins({
+ method => 'before_send_messages',
+ });
+
+ if (@plugins) {
+ foreach my $plugin ( @plugins ) {
+ try {
+ $plugin->before_send_messages();
+ }
+ catch {
+ warn "$_";
+ };
+ }
+ }
+}
+
C4::Letters::SendQueuedMessages(
{
verbose => $verbose,