Lines 418-424
sub SendAlerts {
Link Here
|
418 |
|
418 |
|
419 |
# warn "sending issues..."; |
419 |
# warn "sending issues..."; |
420 |
my $userenv = C4::Context->userenv; |
420 |
my $userenv = C4::Context->userenv; |
421 |
my $branchdetails = GetBranchDetail($_->{'branchcode'}); |
421 |
my $library = Koha::Libraries->find( $_->{branchcode} ); |
422 |
my $letter = GetPreparedLetter ( |
422 |
my $letter = GetPreparedLetter ( |
423 |
module => 'serial', |
423 |
module => 'serial', |
424 |
letter_code => $letter_code, |
424 |
letter_code => $letter_code, |
Lines 439-447
sub SendAlerts {
Link Here
|
439 |
my %mail = $message->create_message_headers( |
439 |
my %mail = $message->create_message_headers( |
440 |
{ |
440 |
{ |
441 |
to => $email, |
441 |
to => $email, |
442 |
from => $branchdetails->{'branchemail'}, |
442 |
from => $library->branchemail, |
443 |
replyto => $branchdetails->{'branchreplyto'}, |
443 |
replyto => $library->branchreplyto, |
444 |
sender => $branchdetails->{'branchreturnpath'}, |
444 |
sender => $library->branchreturnpath, |
445 |
subject => Encode::encode( "UTF-8", "" . $letter->{title} ), |
445 |
subject => Encode::encode( "UTF-8", "" . $letter->{title} ), |
446 |
message => $letter->{'is_html'} |
446 |
message => $letter->{'is_html'} |
447 |
? _wrap_html( Encode::encode( "UTF-8", $letter->{'content'} ), |
447 |
? _wrap_html( Encode::encode( "UTF-8", $letter->{'content'} ), |
Lines 569-581
sub SendAlerts {
Link Here
|
569 |
} |
569 |
} |
570 |
# send an "account details" notice to a newly created user |
570 |
# send an "account details" notice to a newly created user |
571 |
elsif ( $type eq 'members' ) { |
571 |
elsif ( $type eq 'members' ) { |
572 |
my $branchdetails = GetBranchDetail($externalid->{'branchcode'}); |
572 |
my $library = Koha::Libraries->find( $externalid->{branchcode} )->unblessed; |
573 |
my $letter = GetPreparedLetter ( |
573 |
my $letter = GetPreparedLetter ( |
574 |
module => 'members', |
574 |
module => 'members', |
575 |
letter_code => $letter_code, |
575 |
letter_code => $letter_code, |
576 |
branchcode => $externalid->{'branchcode'}, |
576 |
branchcode => $externalid->{'branchcode'}, |
577 |
tables => { |
577 |
tables => { |
578 |
'branches' => $branchdetails, |
578 |
'branches' => $library, |
579 |
'borrowers' => $externalid->{'borrowernumber'}, |
579 |
'borrowers' => $externalid->{'borrowernumber'}, |
580 |
}, |
580 |
}, |
581 |
substitute => { 'borrowers.password' => $externalid->{'password'} }, |
581 |
substitute => { 'borrowers.password' => $externalid->{'password'} }, |
Lines 586-594
sub SendAlerts {
Link Here
|
586 |
my %mail = $email->create_message_headers( |
586 |
my %mail = $email->create_message_headers( |
587 |
{ |
587 |
{ |
588 |
to => $externalid->{'emailaddr'}, |
588 |
to => $externalid->{'emailaddr'}, |
589 |
from => $branchdetails->{'branchemail'}, |
589 |
from => $library->{branchemail}, |
590 |
replyto => $branchdetails->{'branchreplyto'}, |
590 |
replyto => $library->{branchreplyto}, |
591 |
sender => $branchdetails->{'branchreturnpath'}, |
591 |
sender => $library->{branchreturnpath}, |
592 |
subject => Encode::encode( "UTF-8", "" . $letter->{'title'} ), |
592 |
subject => Encode::encode( "UTF-8", "" . $letter->{'title'} ), |
593 |
message => $letter->{'is_html'} |
593 |
message => $letter->{'is_html'} |
594 |
? _wrap_html( Encode::encode( "UTF-8", $letter->{'content'} ), |
594 |
? _wrap_html( Encode::encode( "UTF-8", $letter->{'content'} ), |
Lines 1197-1207
sub _send_message_by_email {
Link Here
|
1197 |
my $branch_email = undef; |
1197 |
my $branch_email = undef; |
1198 |
my $branch_replyto = undef; |
1198 |
my $branch_replyto = undef; |
1199 |
my $branch_returnpath = undef; |
1199 |
my $branch_returnpath = undef; |
1200 |
if ($member){ |
1200 |
if ($member) { |
1201 |
my $branchdetail = GetBranchDetail( $member->{'branchcode'} ); |
1201 |
my $library = Koha::Libraries->find( $member->{branchcode} ); |
1202 |
$branch_email = $branchdetail->{'branchemail'}; |
1202 |
$branch_email = $library->branchemail; |
1203 |
$branch_replyto = $branchdetail->{'branchreplyto'}; |
1203 |
$branch_replyto = $library->branchreplyto; |
1204 |
$branch_returnpath = $branchdetail->{'branchreturnpath'}; |
1204 |
$branch_returnpath = $library->branchreturnpath; |
1205 |
} |
1205 |
} |
1206 |
my $email = Koha::Email->new(); |
1206 |
my $email = Koha::Email->new(); |
1207 |
my %sendmail_params = $email->create_message_headers( |
1207 |
my %sendmail_params = $email->create_message_headers( |