|
Lines 462-485
if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){
Link Here
|
| 462 |
# If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. |
462 |
# If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. |
| 463 |
if ( C4::Context->preference("AutoEmailOpacUser") ) { |
463 |
if ( C4::Context->preference("AutoEmailOpacUser") ) { |
| 464 |
#look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead |
464 |
#look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead |
| 465 |
my $emailaddr; |
465 |
my $emailaddr = $patron->notice_email_address; |
| 466 |
if (C4::Context->preference("AutoEmailPrimaryAddress") ne 'OFF' && |
|
|
| 467 |
$newdata{C4::Context->preference("AutoEmailPrimaryAddress")} =~ /\w\@\w/ ) { |
| 468 |
$emailaddr = $newdata{C4::Context->preference("AutoEmailPrimaryAddress")} |
| 469 |
} |
| 470 |
elsif ($newdata{email} =~ /\w\@\w/) { |
| 471 |
$emailaddr = $newdata{email} |
| 472 |
} |
| 473 |
elsif ($newdata{emailpro} =~ /\w\@\w/) { |
| 474 |
$emailaddr = $newdata{emailpro} |
| 475 |
} |
| 476 |
elsif ($newdata{B_email} =~ /\w\@\w/) { |
| 477 |
$emailaddr = $newdata{B_email} |
| 478 |
} |
| 479 |
# if we manage to find a valid email address, send notice |
466 |
# if we manage to find a valid email address, send notice |
| 480 |
if ($emailaddr) { |
467 |
if ($emailaddr) { |
| 481 |
$newdata{emailaddr} = $emailaddr; |
|
|
| 482 |
my $err; |
| 483 |
eval { |
468 |
eval { |
| 484 |
my $letter = GetPreparedLetter( |
469 |
my $letter = GetPreparedLetter( |
| 485 |
module => 'members', |
470 |
module => 'members', |
| 486 |
- |
|
|