Lines 309-315
sub SendAlerts {
Link Here
|
309 |
Message => Encode::encode( "utf8", "" . $letter->{content} ), |
309 |
Message => Encode::encode( "utf8", "" . $letter->{content} ), |
310 |
'Content-Type' => 'text/plain; charset="utf8"', |
310 |
'Content-Type' => 'text/plain; charset="utf8"', |
311 |
); |
311 |
); |
312 |
sendmail(%mail) or carp $Mail::Sendmail::error; |
312 |
unless ( sendmail(%mail) ) { |
|
|
313 |
carp $Mail::Sendmail::error; |
314 |
return { error => $Mail::Sendmail::error }; |
315 |
} |
313 |
} |
316 |
} |
314 |
} |
317 |
} |
315 |
elsif ( $type eq 'claimacquisition' or $type eq 'claimissues' ) { |
318 |
elsif ( $type eq 'claimacquisition' or $type eq 'claimissues' ) { |
Lines 351-357
sub SendAlerts {
Link Here
|
351 |
push @email, $databookseller->{contemail} if $databookseller->{contemail}; |
354 |
push @email, $databookseller->{contemail} if $databookseller->{contemail}; |
352 |
unless (@email) { |
355 |
unless (@email) { |
353 |
warn "Bookseller $dataorders->[0]->{booksellerid} without emails"; |
356 |
warn "Bookseller $dataorders->[0]->{booksellerid} without emails"; |
354 |
return { error => "no_email" }; |
357 |
return { error => "no_to_address" }; |
355 |
} |
358 |
} |
356 |
|
359 |
|
357 |
my $userenv = C4::Context->userenv; |
360 |
my $userenv = C4::Context->userenv; |
Lines 375-381
sub SendAlerts {
Link Here
|
375 |
Message => Encode::encode( "utf8", "" . $letter->{content} ), |
378 |
Message => Encode::encode( "utf8", "" . $letter->{content} ), |
376 |
'Content-Type' => 'text/plain; charset="utf8"', |
379 |
'Content-Type' => 'text/plain; charset="utf8"', |
377 |
); |
380 |
); |
378 |
sendmail(%mail) or carp $Mail::Sendmail::error; |
381 |
|
|
|
382 |
unless ( sendmail(%mail) ) { |
383 |
carp $Mail::Sendmail::error; |
384 |
return { error => $Mail::Sendmail::error }; |
385 |
} |
379 |
|
386 |
|
380 |
logaction( |
387 |
logaction( |
381 |
"ACQUISITION", |
388 |
"ACQUISITION", |
Lines 404-410
sub SendAlerts {
Link Here
|
404 |
want_librarian => 1, |
411 |
want_librarian => 1, |
405 |
) or return; |
412 |
) or return; |
406 |
|
413 |
|
407 |
return { error => "no_email" } unless $externalid->{'emailaddr'}; |
414 |
return { error => "no_to_address" } unless $externalid->{'emailaddr'}; |
408 |
my %mail = ( |
415 |
my %mail = ( |
409 |
To => $externalid->{'emailaddr'}, |
416 |
To => $externalid->{'emailaddr'}, |
410 |
From => $branchdetails->{'branchemail'} || C4::Context->preference("KohaAdminEmailAddress"), |
417 |
From => $branchdetails->{'branchemail'} || C4::Context->preference("KohaAdminEmailAddress"), |
Lines 412-418
sub SendAlerts {
Link Here
|
412 |
Message => Encode::encode( "utf8", $letter->{'content'} ), |
419 |
Message => Encode::encode( "utf8", $letter->{'content'} ), |
413 |
'Content-Type' => 'text/plain; charset="utf8"', |
420 |
'Content-Type' => 'text/plain; charset="utf8"', |
414 |
); |
421 |
); |
415 |
sendmail(%mail) or carp $Mail::Sendmail::error; |
422 |
unless ( sendmail(%mail) ) { |
|
|
423 |
carp $Mail::Sendmail::error; |
424 |
return { error => $Mail::Sendmail::error }; |
425 |
} |
416 |
} |
426 |
} |
417 |
} |
427 |
} |
418 |
|
428 |
|