Lines 1231-1236
Returns the empty string if no email address.
Link Here
|
1231 |
|
1231 |
|
1232 |
sub notice_email_address{ |
1232 |
sub notice_email_address{ |
1233 |
my ( $self ) = @_; |
1233 |
my ( $self ) = @_; |
|
|
1234 |
my $address; |
1235 |
my $guarantor_address; |
1234 |
|
1236 |
|
1235 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
1237 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
1236 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
1238 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
Lines 1240-1246
sub notice_email_address{
Link Here
|
1240 |
$address = $self->$which_address || ''; |
1242 |
$address = $self->$which_address || ''; |
1241 |
} |
1243 |
} |
1242 |
|
1244 |
|
1243 |
return $self->$which_address || ''; |
1245 |
my $use_guarantor = C4::Context->preference('RedirectGuaranteeEmail'); |
|
|
1246 |
if ($use_guarantor) { |
1247 |
my $guarantor = $self->guarantor; |
1248 |
if ($guarantor) { |
1249 |
if ( $which_address eq 'OFF' ) { |
1250 |
$guarantor_address = $guarantor->first_valid_email_address; |
1251 |
} else { |
1252 |
$guarantor_address = $guarantor->$which_address || ''; |
1253 |
} |
1254 |
if ($address){ |
1255 |
$address .= ', '; |
1256 |
} |
1257 |
$address .= $guarantor_address if $guarantor_address; |
1258 |
} |
1259 |
} |
1260 |
return $address; |
1244 |
} |
1261 |
} |
1245 |
|
1262 |
|
1246 |
=head3 first_valid_email_address |
1263 |
=head3 first_valid_email_address |
1247 |
- |
|
|