|
Lines 73-85
if ( $query->param('sendEmail') || $query->param('resendEmail') ) {
Link Here
|
| 73 |
$errMultipleAccountsForEmail = 1; |
73 |
$errMultipleAccountsForEmail = 1; |
| 74 |
} |
74 |
} |
| 75 |
elsif ( $borrower = $search_results->next() ) { # One matching borrower |
75 |
elsif ( $borrower = $search_results->next() ) { # One matching borrower |
| 76 |
my @emails = ( $borrower->email || '', $borrower->emailpro || '', $borrower->B_email || ''); |
76 |
my @emails = grep { $_ } ( $borrower->email, $borrower->emailpro, $borrower->B_email ); |
| 77 |
|
77 |
|
| 78 |
my $firstNonEmptyEmail = ''; |
78 |
my $firstNonEmptyEmail = shift @emails; |
| 79 |
foreach my $address ( @emails ) { |
|
|
| 80 |
$firstNonEmptyEmail = $address if length $address; |
| 81 |
last if $firstNonEmptyEmail; |
| 82 |
} |
| 83 |
|
79 |
|
| 84 |
# Is the given email one of the borrower's ? |
80 |
# Is the given email one of the borrower's ? |
| 85 |
if ( $email && !( grep /^$email$/i, @emails ) ) { |
81 |
if ( $email && !( grep /^$email$/i, @emails ) ) { |
| 86 |
- |
|
|