View | Details | Raw Unified | Return to bug 37869
Collapse All | Expand All

(-)a/C4/Letters.pm (+18 lines)
Lines 1021-1026 sub SendQueuedMessages { Link Here
1021
    Koha::Exceptions::BadParameter->throw("Parameter message_id cannot be empty if passed.")
1021
    Koha::Exceptions::BadParameter->throw("Parameter message_id cannot be empty if passed.")
1022
        if ( exists( $params->{message_id} ) && !$params->{message_id} );
1022
        if ( exists( $params->{message_id} ) && !$params->{message_id} );
1023
1023
1024
    if ( C4::Context->config("enable_plugins") ) {
1025
        my @plugins = Koha::Plugins->new->GetPlugins({
1026
            method => 'before_send_messages',
1027
        });
1028
1029
        if (@plugins) {
1030
            foreach my $plugin ( @plugins ) {
1031
                try {
1032
                    $plugin->before_send_messages($params);
1033
                }
1034
                catch {
1035
                    warn "$_";
1036
                    exit 1 if $params->{exit_on_plugin_failure};
1037
                };
1038
            }
1039
        }
1040
    }
1041
1024
    my $smtp_transports = {};
1042
    my $smtp_transports = {};
1025
1043
1026
    my $count_messages = 0;
1044
    my $count_messages = 0;
(-)a/misc/cronjobs/process_message_queue.pl (-27 / +1 lines)
Lines 92-123 cronlogaction({ info => $command_line_options }); Link Here
92
# Remove empty elements, see bug 37075
92
# Remove empty elements, see bug 37075
93
@letter_code = grep { $_ ne q{} } @letter_code;
93
@letter_code = grep { $_ ne q{} } @letter_code;
94
94
95
if ( C4::Context->config("enable_plugins") ) {
96
    my @plugins = Koha::Plugins->new->GetPlugins({
97
        method => 'before_send_messages',
98
    });
99
100
    if (@plugins) {
101
        foreach my $plugin ( @plugins ) {
102
            try {
103
                $plugin->before_send_messages(
104
                    {
105
                        verbose     => $verbose,
106
                        limit       => $limit,
107
                        type        => \@type,
108
                        letter_code => \@letter_code,
109
                        where       => $where,
110
                    }
111
                );
112
            }
113
            catch {
114
                warn "$_";
115
                exit 1 if $exit_on_plugin_failure;
116
            };
117
        }
118
    }
119
}
120
121
C4::Letters::SendQueuedMessages(
95
C4::Letters::SendQueuedMessages(
122
    {
96
    {
123
        verbose     => $verbose,
97
        verbose     => $verbose,
Lines 128-133 C4::Letters::SendQueuedMessages( Link Here
128
        type        => \@type,
102
        type        => \@type,
129
        letter_code => \@letter_code,
103
        letter_code => \@letter_code,
130
        where       => $where,
104
        where       => $where,
105
        exit_on_plugin_failure => $exit_on_plugin_failure,
131
    }
106
    }
132
);
107
);
133
108
134
- 

Return to bug 37869