&GetPendingIssues
&GetAllIssues
- &GetFirstValidEmailAddress
&GetNoticeEmailAddress
&GetMemberAccountRecords
return ( $min, $max );
}
-=head2 GetFirstValidEmailAddress
-
- $email = GetFirstValidEmailAddress($borrowernumber);
-
-Return the first valid email address for a borrower, given the borrowernumber. For now, the order
-is defined as email, emailpro, B_email. Returns the empty string if the borrower has no email
-addresses.
-
-=cut
-
-sub GetFirstValidEmailAddress {
- my $borrowernumber = shift;
-
- my $borrower = Koha::Patrons->find( $borrowernumber );
-
- return $borrower->first_valid_email_address();
-}
-
=head2 GetNoticeEmailAddress
$email = GetNoticeEmailAddress($borrowernumber);
my $which_address = C4::Context->preference("AutoEmailPrimaryAddress");
# if syspref is set to 'first valid' (value == OFF), look up email address
if ( $which_address eq 'OFF' ) {
- return GetFirstValidEmailAddress($borrowernumber);
+ my $patron = Koha::Patrons->find( $borrowernumber );
+ return $patron->first_valid_email_address();
}
# specified email address field
my $dbh = C4::Context->dbh;
=head3 first_valid_email_address
+my $first_valid_email_address = $patron->first_valid_email_address
+
+Return the first valid email address for a patron.
+For now, the order is defined as email, emailpro, B_email.
+Returns the empty string if the borrower has no email addresses.
+
=cut
sub first_valid_email_address {
});
my $email = Koha::Email->new();
my $patron = Koha::Patrons->find( $borrowernumber );
- my $user_email = GetFirstValidEmailAddress($borrowernumber)
+ my $user_email = $patron->first_valid_email_address
|| C4::Context->preference('KohaAdminEmailAddress');
my $email_replyto = $patron->firstname . " " . $patron->surname . " <$user_email>";