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

(-)a/Koha/Patron.pm (-1 / +2 lines)
Lines 2649-2655 sub queue_notice { Link Here
2649
                message_name => $params->{message_name}
2649
                message_name => $params->{message_name}
2650
        } );
2650
        } );
2651
        @message_transports = ( keys %{ $messaging_prefs->{transports} } );
2651
        @message_transports = ( keys %{ $messaging_prefs->{transports} } );
2652
        $letter_code = $messaging_prefs->{transports}->{$message_transports[0]} unless $letter_code;
2652
        $letter_code = $messaging_prefs->{transports}->{ $message_transports[0] } unless $letter_code;
2653
        return if ( $params->{message_name} eq 'Patron_Expiry' && !$messaging_prefs );
2653
    } else {
2654
    } else {
2654
        @message_transports = @{$params->{message_transports}};
2655
        @message_transports = @{$params->{message_transports}};
2655
    }
2656
    }
(-)a/misc/cronjobs/membership_expiry.pl (-19 / +7 lines)
Lines 262-301 while ( my $expiring_patron = $upcoming_mem_expires->next ) { Link Here
262
        next;
262
        next;
263
    }
263
    }
264
264
265
    my $messaging_prefs = C4::Members::Messaging::GetMessagingPreferences(
266
        {
267
            borrowernumber => $expiring_patron->borrowernumber,
268
            message_name   => "Patron_Expiry",
269
        }
270
    );
271
    my @message_transports = ( keys %{ $messaging_prefs->{transports} } );
272
    my $letter_code = $messaging_prefs->{letter_code};
273
274
    # Skip this patron if they don't want a notification email for card expiry
275
    next if !$messaging_prefs;
276
277
    my $which_notice;
265
    my $which_notice;
278
    if ($renew) {
266
    if ($renew) {
279
        $expiring_patron->renew_account;
267
        $expiring_patron->renew_account;
280
        $which_notice = $letter_renew;
268
        $which_notice = $letter_renew;
281
        $count_renewed++;
269
        $count_renewed++;
282
    } else {
270
    } else {
283
        $which_notice = $letter_code || $letter_expiry;
271
        $which_notice = $letter_expiry;
284
    }
272
    }
285
273
286
    my $from_address  = $expiring_patron->library->from_email_address;
274
    my $from_address  = $expiring_patron->library->from_email_address;
287
    my $letter_params = {
275
    my $letter_params = {
288
        module      => 'members',
276
        module         => 'members',
289
        letter_code => $which_notice,
277
        letter_code    => $which_notice,
290
        branchcode  => $expiring_patron->branchcode,
278
        branchcode     => $expiring_patron->branchcode,
291
        lang        => $expiring_patron->lang,
279
        lang           => $expiring_patron->lang,
292
        borrowernumber => $expiring_patron->borrowernumber,
280
        borrowernumber => $expiring_patron->borrowernumber,
293
        tables      => {
281
        tables         => {
294
            borrowers => $expiring_patron->borrowernumber,
282
            borrowers => $expiring_patron->borrowernumber,
295
            branches  => $expiring_patron->branchcode,
283
            branches  => $expiring_patron->branchcode,
296
        },
284
        },
297
    };
285
    };
298
286
287
299
    my $sending_params = {
288
    my $sending_params = {
300
        letter_params => $letter_params,
289
        letter_params => $letter_params,
301
        message_name => 'Patron_Expiry',
290
        message_name => 'Patron_Expiry',
302
- 

Return to bug 30300