Bug 24258

Summary: Sending partner request doesn't fall back to KohaAdminEmailAddress
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: ILLAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: Niamh.WalkerHeadon, raymund.delahunty
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

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;
}