Lines 2093-2098
sub account_balance {
Link Here
|
2093 |
return $self->account->balance; |
2093 |
return $self->account->balance; |
2094 |
} |
2094 |
} |
2095 |
|
2095 |
|
|
|
2096 |
=head3 notify_library_of_registration |
2097 |
|
2098 |
$patron->notify_library_of_registration( $email_patron_registrations ); |
2099 |
|
2100 |
Send patron registration email to library if EmailPatronRegistrations system preference is enabled. |
2101 |
|
2102 |
=cut |
2103 |
|
2104 |
sub notify_library_of_registration { |
2105 |
my ( $self, $email_patron_registrations ) = @_; |
2106 |
|
2107 |
if ( |
2108 |
my $letter = C4::Letters::GetPreparedLetter( |
2109 |
module => 'members', |
2110 |
letter_code => 'OPAC_REG', |
2111 |
branchcode => $self->branchcode, |
2112 |
lang => $self->lang || 'default', |
2113 |
tables => { |
2114 |
'borrowers' => $self->borrowernumber |
2115 |
}, |
2116 |
) |
2117 |
) { |
2118 |
my $to_address; |
2119 |
if ( $email_patron_registrations eq "BranchEmailAddress" ) { |
2120 |
my $library = Koha::Libraries->find( $self->branchcode ); |
2121 |
$to_address = $library->inbound_email_address; |
2122 |
} |
2123 |
elsif ( $email_patron_registrations eq "KohaAdminEmailAddress" ) { |
2124 |
$to_address = C4::Context->preference('ReplytoDefault') |
2125 |
|| C4::Context->preference('KohaAdminEmailAddress'); |
2126 |
} |
2127 |
else { |
2128 |
$to_address = |
2129 |
C4::Context->preference('EmailAddressForPatronRegistrations') |
2130 |
|| C4::Context->preference('ReplytoDefault') |
2131 |
|| C4::Context->preference('KohaAdminEmailAddress'); |
2132 |
} |
2133 |
|
2134 |
my $message_id = C4::Letters::EnqueueLetter( |
2135 |
{ |
2136 |
letter => $letter, |
2137 |
borrowernumber => $self->borrowernumber, |
2138 |
to_address => $to_address, |
2139 |
message_transport_type => 'email' |
2140 |
} |
2141 |
) or warn "can't enqueue letter $letter"; |
2142 |
if ( $message_id ) { |
2143 |
return 1; |
2144 |
} |
2145 |
} |
2146 |
} |
2096 |
|
2147 |
|
2097 |
=head3 has_messaging_preference |
2148 |
=head3 has_messaging_preference |
2098 |
|
2149 |
|