Lines 165-172
sub notify_owner {
Link Here
|
165 |
my $patron = Koha::Patrons->find( $param->{owner} ); |
165 |
my $patron = Koha::Patrons->find( $param->{owner} ); |
166 |
return unless $patron; |
166 |
return unless $patron; |
167 |
|
167 |
|
168 |
my $toaddr = $patron->notice_email_address or return; |
168 |
my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email'; |
169 |
|
169 |
|
|
|
170 |
warn $transport; |
171 |
my $toaddr = $transport eq 'sms' ? $patron->smsalertnumber : $patron->notice_email_address or return; |
172 |
|
173 |
warn $toaddr; |
170 |
#prepare letter |
174 |
#prepare letter |
171 |
my $letter = C4::Letters::GetPreparedLetter( |
175 |
my $letter = C4::Letters::GetPreparedLetter( |
172 |
module => 'members', |
176 |
module => 'members', |
Lines 181-187
sub notify_owner {
Link Here
|
181 |
C4::Letters::EnqueueLetter( |
185 |
C4::Letters::EnqueueLetter( |
182 |
{ |
186 |
{ |
183 |
letter => $letter, |
187 |
letter => $letter, |
184 |
message_transport_type => 'email', |
188 |
message_transport_type => $transport, |
185 |
from_address => C4::Context->preference('KohaAdminEmailAddress'), |
189 |
from_address => C4::Context->preference('KohaAdminEmailAddress'), |
186 |
to_address => $toaddr, |
190 |
to_address => $toaddr, |
187 |
} |
191 |
} |
Lines 209-214
sub process_addrlist {
Link Here
|
209 |
|
213 |
|
210 |
sub send_invitekey { |
214 |
sub send_invitekey { |
211 |
my ($param) = @_; |
215 |
my ($param) = @_; |
|
|
216 |
|
212 |
my $fromaddr = C4::Context->preference('KohaAdminEmailAddress'); |
217 |
my $fromaddr = C4::Context->preference('KohaAdminEmailAddress'); |
213 |
my $url = |
218 |
my $url = |
214 |
C4::Context->preference('OPACBaseURL') |
219 |
C4::Context->preference('OPACBaseURL') |
215 |
- |
|
|