Bug 24258 - Sending partner request doesn't fall back to KohaAdminEmailAddress
Summary: Sending partner request doesn't fall back to KohaAdminEmailAddress
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-17 16:13 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:42 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2019-12-17 16:13:16 UTC
The code only looks for the branchemail, and if there is none, it doesn't fall back to KohaAdminEmailAddress.

To reproduce :
- If your branches have emails, remove them
- Make sure KohaAdminEmailAddress is filled
- Go to ILL module
- Create a request
- Click on 'Place request with partners'
- Click 'Send email'

I get an error message 'Your library has no usable email address. Please set it.'
Comment 1 Katrin Fischer 2023-01-13 12:42:33 UTC
OK, this took a little digging:


* The message is queued using EnqueueLetter
* The $from parameter is passed explicitly here as:

my $from_address = $branch->from_email_address;

* And that has the fallback to KohaAdminEmailAddress:

sub from_email_address {
    my ($self) = @_;

    return
         $self->branchemail
      || C4::Context->preference('KohaAdminEmailAddress')
      || undef;
}