Skip to content

Commit da416f3

Browse files
author
Oleksii Korshenko
committed
MAGETWO-66222: [GitHub][PR] Include Reply-To name in contact form email header #8903
- Merge Pull Request #8903 from AbsoluteCommerce/magento2:feature/contact-form-reply-to-name
2 parents aa27856 + 982b662 commit da416f3

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['name']) ? $variables['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)