Skip to content

Commit 6e87013

Browse files
author
Oleksii Korshenko
authored
MAGETWO-66222: [GitHub][PR] Include Reply-To name in contact form email header #8903
2 parents 2d24121 + 96f01c5 commit 6e87013

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/code/Magento/Contact/Model/Mail.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public function __construct(
4949
*/
5050
public function send($replyTo, array $variables)
5151
{
52+
/** @see \Magento\Contact\Controller\Index\Post::validatedParams() */
53+
$replyToName = !empty($variables['data']['name']) ? $variables['data']['name'] : null;
54+
5255
$this->inlineTranslation->suspend();
5356
try {
5457
$transport = $this->transportBuilder
@@ -62,7 +65,7 @@ public function send($replyTo, array $variables)
6265
->setTemplateVars($variables)
6366
->setFrom($this->contactsConfig->emailSender())
6467
->addTo($this->contactsConfig->emailRecipient())
65-
->setReplyTo($replyTo)
68+
->setReplyTo($replyTo, $replyToName)
6669
->getTransport();
6770

6871
$transport->sendMessage();

0 commit comments

Comments
 (0)