Bugzilla – Attachment 122056 Details for
Bug 28581
Patron's queue_notice uses inbound_email_address incorrectly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28581: Add 'from_email_address' method and use in Koha::Patron
Bug-28581-Add-fromemailaddress-method-and-use-in-K.patch (text/plain), 2.65 KB, created by
Martin Renvoize (ashimema)
on 2021-06-17 08:57:51 UTC
(
hide
)
Description:
Bug 28581: Add 'from_email_address' method and use in Koha::Patron
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-06-17 08:57:51 UTC
Size:
2.65 KB
patch
obsolete
>From 560e5c69547af04385054b5525a67705f6e0d917 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 17 Jun 2021 09:54:46 +0100 >Subject: [PATCH] Bug 28581: Add 'from_email_address' method and use in > Koha::Patron > >This patch adds a new 'from_email_address' method to Koha::Library to >return the appropriate email address to use as the 'from' field for >email notices from the library. > >We then update Koha::Patron->queue_notice to use this new method instead >of the incorrect inbound_email_address. > >I also update the POD for inbound_email_address to clarify it's use >case. >--- > Koha/Library.pm | 23 +++++++++++++++++++++++ > Koha/Patron.pm | 4 ++-- > 2 files changed, 25 insertions(+), 2 deletions(-) > >diff --git a/Koha/Library.pm b/Koha/Library.pm >index 676c9e8da2..1ad76d911b 100644 >--- a/Koha/Library.pm >+++ b/Koha/Library.pm >@@ -143,12 +143,35 @@ sub smtp_server { > return $self; > } > >+=head3 from_email_address >+ >+ my $from_email = Koha::Library->from_email_address; >+ >+Returns the official 'from' email address for the branch. >+ >+It may well be a 'noreply' or other inaccessible local domain >+address that is being used to satisfy spam protection filters. >+ >+=cut >+ >+sub from_email_address { >+ my ($self) = @_; >+ >+ return >+ || $self->branchemail >+ || C4::Context->preference('KohaAdminEmailAddress') >+ || undef; >+} >+ > =head3 inbound_email_address > > my $to_email = Koha::Library->inbound_email_address; > > Returns an effective email address which should be accessible to librarians at the branch. > >+NOTE: This is the address to use for 'reply_to' or 'to' fields; It should not usually be >+used as the 'from' address for emails as it may lead to mail being caught by spam filters. >+ > =cut > > sub inbound_email_address { >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index dc87674f4d..a8379f6228 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1874,7 +1874,7 @@ sub queue_notice { > return unless exists $params->{message_name} xor $params->{message_transports}; # We only want one of these > > my $library = Koha::Libraries->find( $letter_params->{branchcode} ); >- my $admin_email_address = $library->inbound_email_address; >+ my $from_email_address = $library->from_email_address; > > my @message_transports; > my $letter_code; >@@ -1909,7 +1909,7 @@ sub queue_notice { > C4::Letters::EnqueueLetter({ > letter => $letter, > borrowernumber => $self->borrowernumber, >- from_address => $admin_email_address, >+ from_address => $from_email_address, > message_transport_type => $mtt > }) unless $test_mode; > push @{$return{sent}}, $mtt; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28581
:
122056
|
122057
|
122061
|
122062
|
122063
|
122067
|
122068
|
122071
|
122072
|
122073
|
122074
|
122075
|
122076
|
122078
|
122080
|
122081
|
122136
|
122137
|
122138
|
122139
|
122140
|
122212