Project

General

Profile

Actions

Bug #69395

closed

EXT:form - Allow ReplyTo

Added by Christian Hernmarck over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Form Framework
Target version:
-
Start date:
2015-08-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

With the former mailform there was an option to set the "replyto" mail header field (needed because of SPF).

In the new form this is not yet implemented - so it's not possible to send mails where you can answer to the entered mail address by just hitting "reply" (without running into problems with SPF - eg. as entered mail address).

Here's a simple patch, adopted from the "setFrom()" method.

--- typo3_src-6.2.14/typo3/sysext/form/Classes/PostProcess/MailPostProcessor.php.orig   2015-07-01 16:40:01.000000000 +0200
+++ typo3_src-6.2.14/typo3/sysext/form/Classes/PostProcess/MailPostProcessor.php        2015-08-28 15:56:48.456316401 +0200
@@ -71,6 +71,7 @@
                $this->setFrom();
                $this->setTo();
                $this->setCc();
+               $this->setReplyTo();
                $this->setPriority();
                $this->setOrganization();
                // @todo The whole content rendering seems to be missing here!
@@ -195,6 +196,24 @@
        }

        /**
+        * Sets the replyto of the mail message
+        *
+        * Checks the address if it is a valid email address
+        *
+        * @return void
+        */
+       protected function setReplyTo() {
+               $replytoEmail = '';
+               if ($this->typoScript['replytoEmail']) {
+                       $replytoEmail = $this->typoScript['replytoEmail'];
+               } elseif ($this->requestHandler->has($this->typoScript['replytoEmailField'])) {
+                       $replytoEmail = $this->requestHandler->get($this->typoScript['replytoEmailField']);
+               } 
+               $replytoName = '';
+               $this->mailMessage->setReplyTo($replytoEmail, $replytoName);
+       }
+
+       /**
         * Set the priority of the mail message
         *
         * When not in settings, the value will be 3. If the priority is configured,

The replyToName was also possible - but I can live without that :-)

Also see: #68771


Files

form75_replyto.patch (1.43 KB) form75_replyto.patch Christian Hernmarck, 2015-09-25 14:40

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #68771: EXT:form - Add contentObject functionality to form MailPostProcessor and introduce replyToEmailClosed2015-08-05

Actions
Actions

Also available in: Atom PDF