Bug 22823: Add get_effective_email method to Koha::Library
Add a `get_effective_email` method to the Koha::Library object which returns the email address for the library which they are most likely to have access to. This method falls back through preferences `branchreplyto`, `branchemail`, `ReplytoDefault`, `KohaAdminEmailAddress`. This bug simply introduces a new utility function to return the most effective email address for a branch to be emailed on. Test plan 1/ Read the new test and verify it makes sense 2/ Run the tests and verify they all pass. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
b16d433943
commit
40c08434d4
1 changed files with 18 additions and 0 deletions
|
@ -65,6 +65,24 @@ sub get_effective_marcorgcode {
|
|||
return $self->marcorgcode || C4::Context->preference("MARCOrgCode");
|
||||
}
|
||||
|
||||
=head3 get_effective_email
|
||||
|
||||
my $to_email = Koha::Library->get_effective_email;
|
||||
|
||||
Returns an effective email address which should be accessible to librarians at the branch.
|
||||
|
||||
=cut
|
||||
|
||||
sub get_effective_email {
|
||||
my ($self) = @_;
|
||||
|
||||
return
|
||||
$self->branchreplyto
|
||||
|| $self->branchemail
|
||||
|| C4::Context->preference('ReplytoDefault')
|
||||
|| C4::Context->preference('KohaAdminEmailAddress');
|
||||
}
|
||||
|
||||
=head3 library_groups
|
||||
|
||||
Return the Library groups of this library
|
||||
|
|
Loading…
Reference in a new issue