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 |
- |
|
|