From 810d757a04c2678e980103f586a426cb7d733aff Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Thu, 1 Sep 2022 11:19:36 +0200 Subject: [PATCH] Update of ResultFeedback module. --- .../Controller/ResultFeedbackController.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/module/ResultFeedback/src/ResultFeedback/Controller/ResultFeedbackController.php b/module/ResultFeedback/src/ResultFeedback/Controller/ResultFeedbackController.php index f6844d0d1a..a40314eb99 100644 --- a/module/ResultFeedback/src/ResultFeedback/Controller/ResultFeedbackController.php +++ b/module/ResultFeedback/src/ResultFeedback/Controller/ResultFeedbackController.php @@ -119,6 +119,17 @@ public function emailAction() // This sets up the email to be sent // Attempt to send the email and show an appropriate flash message: + + $replyTo = $view->email; + if (isset($resultFeedbackConfig['resultFeedback']['set_user_email_as_reply_to']) && !$resultFeedbackConfig['resultFeedback']['set_user_email_as_reply_to']) { + $replyTo = new Address($view->email, $view->name); + } + + $cc = null; + if (isset($resultFeedbackConfig['resultFeedback']['set_user_email_as_cc']) && $resultFeedbackConfig['resultFeedback']['set_user_email_as_cc']) { + $cc = new Address($view->email, $view->name); + } + try { $mailer = $this->serviceLocator->get('VuFind\Mailer\Mailer'); $mailer->send( @@ -126,8 +137,8 @@ public function emailAction() new Address($sender_email, $sender_name), $email_subject, $email_message, - null, - $view->email + $cc, + $replyTo ); $this->flashMessenger()->addMessage( 'Your result feedback has been send', 'success'