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