Lines 1717-1727
sub _koha_notify_reserve {
Link Here
|
1717 |
my $messagingprefs; |
1717 |
my $messagingprefs; |
1718 |
if ( $to_address || $borrower->{'smsalertnumber'} ) { |
1718 |
if ( $to_address || $borrower->{'smsalertnumber'} ) { |
1719 |
$messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold_Filled' } ); |
1719 |
$messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold_Filled' } ); |
1720 |
|
|
|
1721 |
return if ( !defined( $messagingprefs->{'letter_code'} ) ); |
1722 |
$letter_code = $messagingprefs->{'letter_code'}; |
1723 |
} else { |
1720 |
} else { |
1724 |
$letter_code = 'HOLD_PRINT'; |
|
|
1725 |
$print_mode = 1; |
1721 |
$print_mode = 1; |
1726 |
} |
1722 |
} |
1727 |
|
1723 |
|
Lines 1737-1745
sub _koha_notify_reserve {
Link Here
|
1737 |
|
1733 |
|
1738 |
my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'); |
1734 |
my $admin_email_address = $branch_details->{'branchemail'} || C4::Context->preference('KohaAdminEmailAddress'); |
1739 |
|
1735 |
|
1740 |
my $letter = C4::Letters::GetPreparedLetter ( |
1736 |
my %letter_params = ( |
1741 |
module => 'reserves', |
1737 |
module => 'reserves', |
1742 |
letter_code => $letter_code, |
|
|
1743 |
branchcode => $reserve->{branchcode}, |
1738 |
branchcode => $reserve->{branchcode}, |
1744 |
tables => { |
1739 |
tables => { |
1745 |
'branches' => $branch_details, |
1740 |
'branches' => $branch_details, |
Lines 1749-1759
sub _koha_notify_reserve {
Link Here
|
1749 |
'items', $reserve->{'itemnumber'}, |
1744 |
'items', $reserve->{'itemnumber'}, |
1750 |
}, |
1745 |
}, |
1751 |
substitute => { today => C4::Dates->new()->output() }, |
1746 |
substitute => { today => C4::Dates->new()->output() }, |
1752 |
) or die "Could not find a letter called '$letter_code' in the 'reserves' module"; |
1747 |
); |
1753 |
|
|
|
1754 |
|
1748 |
|
1755 |
|
1749 |
|
1756 |
if ( $print_mode ) { |
1750 |
if ( $print_mode ) { |
|
|
1751 |
$letter_params{ 'letter_code' } = 'HOLD_PRINT'; |
1752 |
my $letter = C4::Letters::GetPreparedLetter ( %letter_params ) or die "Could not find a letter called '$letter_params{'letter_code'}' in the 'reserves' module"; |
1753 |
|
1757 |
C4::Letters::EnqueueLetter( { |
1754 |
C4::Letters::EnqueueLetter( { |
1758 |
letter => $letter, |
1755 |
letter => $letter, |
1759 |
borrowernumber => $borrowernumber, |
1756 |
borrowernumber => $borrowernumber, |
Lines 1763-1770
sub _koha_notify_reserve {
Link Here
|
1763 |
return; |
1760 |
return; |
1764 |
} |
1761 |
} |
1765 |
|
1762 |
|
1766 |
if ( grep { $_ eq 'email' } @{$messagingprefs->{transports}} ) { |
1763 |
if ( $to_address && defined $messagingprefs->{transports}->{'email'} ) { |
1767 |
# aka, 'email' in ->{'transports'} |
1764 |
$letter_params{ 'letter_code' } = $messagingprefs->{transports}->{'email'}; |
|
|
1765 |
my $letter = C4::Letters::GetPreparedLetter ( %letter_params ) or die "Could not find a letter called '$letter_params{'letter_code'}' in the 'reserves' module"; |
1766 |
|
1768 |
C4::Letters::EnqueueLetter( |
1767 |
C4::Letters::EnqueueLetter( |
1769 |
{ letter => $letter, |
1768 |
{ letter => $letter, |
1770 |
borrowernumber => $borrowernumber, |
1769 |
borrowernumber => $borrowernumber, |
Lines 1774-1780
sub _koha_notify_reserve {
Link Here
|
1774 |
); |
1773 |
); |
1775 |
} |
1774 |
} |
1776 |
|
1775 |
|
1777 |
if ( grep { $_ eq 'sms' } @{$messagingprefs->{transports}} ) { |
1776 |
if ( $borrower->{'smsalertnumber'} && defined $messagingprefs->{transports}->{'sms'} ) { |
|
|
1777 |
$letter_params{ 'letter_code' } = $messagingprefs->{transports}->{'sms'}; |
1778 |
my $letter = C4::Letters::GetPreparedLetter ( %letter_params ) or die "Could not find a letter called '$letter_params{'letter_code'}' in the 'reserves' module"; |
1779 |
|
1778 |
C4::Letters::EnqueueLetter( |
1780 |
C4::Letters::EnqueueLetter( |
1779 |
{ letter => $letter, |
1781 |
{ letter => $letter, |
1780 |
borrowernumber => $borrowernumber, |
1782 |
borrowernumber => $borrowernumber, |