Skip to content

Commit

Permalink
Update of ResultFeedback module.
Browse files Browse the repository at this point in the history
  • Loading branch information
jschultze committed Sep 1, 2022
1 parent f382e2d commit 810d757
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,26 @@ 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(
new Address($recipient_email, $recipient_name),
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'
Expand Down

0 comments on commit 810d757

Please sign in to comment.