Lines 1023-1053
Returns the empty string if no email address.
Link Here
|
1023 |
=cut |
1023 |
=cut |
1024 |
|
1024 |
|
1025 |
sub notice_email_address{ |
1025 |
sub notice_email_address{ |
1026 |
my ( $self ) = @_; |
1026 |
my ( $self ) = @_; |
1027 |
my $address; |
1027 |
my $address; |
1028 |
|
1028 |
my $guarantor_address; |
1029 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
1029 |
|
1030 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
1030 |
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress"); |
1031 |
if ( $which_address eq 'OFF' ) { |
1031 |
# if syspref is set to 'first valid' (value == OFF), look up email address |
1032 |
$address = $self->first_valid_email_address; |
1032 |
if ( $which_address eq 'OFF' ) { |
1033 |
} else { |
1033 |
$address = $self->first_valid_email_address; |
1034 |
$address = $self->$which_address || ''; |
1034 |
} else { |
1035 |
} |
1035 |
$address = $self->$which_address || ''; |
1036 |
|
1036 |
} |
1037 |
my $use_guarantor = C4::Context->preference('RedirectGuaranteeEmail'); |
1037 |
|
1038 |
if ($use_guarantor) { |
1038 |
my $use_guarantor = C4::Context->preference('RedirectGuaranteeEmail'); |
1039 |
my $guarantor = $self->guarantor; |
1039 |
if ($use_guarantor) { |
1040 |
if ($guarantor) { |
1040 |
my $guarantor = $self->guarantor; |
1041 |
my $guarantor_address = $guarantor->notice_email_address; |
1041 |
if ($guarantor) { |
1042 |
if ($address){ |
1042 |
if ( $which_address eq 'OFF' ) { |
1043 |
$address .= ', '; |
1043 |
$guarantor_address = $guarantor->first_valid_email_address; |
1044 |
} |
1044 |
} else { |
1045 |
$address .= $guarantor_address if $guarantor_address; |
1045 |
$guarantor_address = $guarantor->$which_address || ''; |
1046 |
} |
1046 |
} |
1047 |
} |
1047 |
if ($address){ |
1048 |
return $address; |
1048 |
$address .= ', '; |
|
|
1049 |
} |
1050 |
$address .= $guarantor_address if $guarantor_address; |
1051 |
} |
1052 |
} |
1053 |
return $address; |
1049 |
} |
1054 |
} |
1050 |
|
1055 |
|
|
|
1056 |
|
1051 |
=head3 first_valid_email_address |
1057 |
=head3 first_valid_email_address |
1052 |
|
1058 |
|
1053 |
my $first_valid_email_address = $patron->first_valid_email_address |
1059 |
my $first_valid_email_address = $patron->first_valid_email_address |
1054 |
- |
|
|