Bug 4461: Drop 'from_address' use 'reply_address'
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 2 Mar 2020 15:16:37 +0000 (15:16 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 10:17:45 +0000 (11:17 +0100)
This patch adds support for using the reply-to field added in bug 10269
and drops 'from_address' as it will get defined at a later stage in the
emailing process anyway.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

opac/opac-reportproblem.pl [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index c8e0d2a..fa6171b
@@ -94,8 +94,8 @@ if ( $op eq 'addreport' ) {
                     }
                 );
 
-                my $from_address = C4::Context->preference('KohaAdminEmailAddress');
                 my $transport = 'email';
+                my $reply_address = $patron->email || $patron->emailpro || $patron->B_email;
 
                 if ( $recipient eq 'admin' ) {
                     C4::Letters::EnqueueLetter({
@@ -103,7 +103,7 @@ if ( $op eq 'addreport' ) {
                         borrowernumber         => $borrowernumber,
                         message_transport_type => $transport,
                         to_address             => C4::Context->preference('KohaAdminEmailAddress'),
-                        from_address           => $from_address,
+                        reply_address          => $reply_address,
                     });
                 } else {
                     C4::Letters::EnqueueLetter({
@@ -111,7 +111,7 @@ if ( $op eq 'addreport' ) {
                         borrowernumber         => $borrowernumber,
                         message_transport_type => $transport,
                         to_address             => $library->branchemail,
-                        from_address           => $from_address,
+                        reply_address          => $reply_address,
                     });
                 }