Bug #69395

EXT:form - Allow ReplyTo

Added by Christian Hernmarck about 6 years ago. Updated about 3 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

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

Actions
#1

Updated by Bjoern Jacob about 6 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from set ReplyTo in the new form to EXT:form - Allow ReplyTo
  • Target version set to 8 LTS

Since it's not part of EXT:form it's not a bug. Instead it's a missing feature.

#2

Updated by Christian Hernmarck about 6 years ago

Using ReplyTo was possible with the old mailform content element.

Since ext:Form is supposed to be the successor of mailform its a "missing feature" which was included in the "legacy version".
And since it's not a big deal to include (the underlying class swiftmailer does implement ReplyTo) I'd wish we won't have to wait until Release/Version 8, which is scheduled to be released in early 2017 (the LTS)!

The bug is: not implementing all features of the to be replaced content element.

I don't know if the solution is "if you need replyto, use the old mailform". It's not very motivating to help to improve this project if you have to wait that long for relatively small changes.
Just my 2 cents.

#3

Updated by Bjoern Jacob about 6 years ago

@Christian: thank you for your reply. I fully agree that this issue is no big deal. But please consider the bigger picture. Some days ago we've finished rewritting EXT:form to Extbase and Fluid. This was a huge task and there are still a lot of open issues we have to tackle first (see #69955). Right now we're in stabilization phase and there won't be new features in 7.5 any more. We can try to get this done for 7.6/ LTS. You're very welcome to provide a patch an your own. Just checkout the current master and get it done. We're happy to review your patch. Thx and don't give up. Your ideas are needed and we do appreciate it. The rewrite allows us now to implement new features much faster but as I said at first we have to shoot the gremlins.

#4

Updated by Gerrit Mohrmann about 6 years ago

For master the replyTo setting is in #68771

#5

Updated by Christian Hernmarck about 6 years ago

Ok, here's my patch.

First tries didn't work - always some oops when sending the form. I had to remove a ", 'Plain'" in this line
$plainContent = $this->getView($this->plaintextMailTemplatePath, 'Plain')->render();
Then it worked (not included in the patch).

My patch adds the possibility to add a reply-to header in the mail, using a combination of

replytoEmail or replytoEmailField and replytoName or replytoNameField

I uesd "addReplyTo" and not "setReplyTo" - I think this is more flexible.

Hope this fits in the devel process....

#6

Updated by Wouter Wolters about 6 years ago

  • Target version changed from 7.5 to 7 LTS
#7

Updated by Bjoern Jacob about 6 years ago

  • Tracker changed from Feature to Bug
  • Status changed from New to Needs Feedback
  • Assignee set to Christian Hernmarck
  • Target version deleted (7 LTS)
  • TYPO3 Version set to 6.2
  • Is Regression set to No

Could you please try to provide a patchset based on the contribution workflow?

This issue is only valid for 6.2. #68771 takes care of v7.

#8

Updated by Gerrit Code Review about 6 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43661

#9

Updated by Christian Hernmarck about 6 years ago

Uh - first patch comitted....

http://review.typo3.org/43661

hope it's ok (sorry for the long lines in the msg).
Please write if something has to be doen...

/Ch

#10

Updated by Gerrit Code Review about 6 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43661

#11

Updated by Bjoern Jacob about 6 years ago

Christian, could you please backport the solution of the master? See see https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Classes/PostProcess/MailPostProcessor.php#L278. Thx!

#12

Updated by Gerrit Code Review about 6 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/43661

#13

Updated by Bjoern Jacob about 6 years ago

  • Assignee changed from Christian Hernmarck to Ralf Zimmermann
#14

Updated by Bjoern Jacob about 6 years ago

Example form for testing.


prefix = tx_form
confirmation = 1
postProcessor {
    1 = mail
    1 {
        recipientEmail = your@mail.com
        senderEmail = your@mail.com
        # test with static email address; this setting has priority
        #replyToEmail = company@mail.com
        # test with dynamic mail field
        replyToEmailField = email
    }
}
10 = TEXTLINE
10 {
    name = email
    label {
        value = Email address
    }
}
30 = SUBMIT
30 {
    name = submit
    value = Submit
}

#15

Updated by Ralf Zimmermann about 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#16

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF