Bug #69395
closedEXT:form - Allow ReplyTo
100%
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. xxx@gmx.net 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
Updated by Björn Jacob about 9 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.
Updated by Christian Hernmarck about 9 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.
Updated by Björn Jacob about 9 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.
Updated by Gerrit Mohrmann about 9 years ago
For master the replyTo setting is in #68771
Updated by Christian Hernmarck about 9 years ago
- File form75_replyto.patch form75_replyto.patch added
- Target version changed from 8 LTS to 7.5
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....
Updated by Wouter Wolters about 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Björn Jacob about 9 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.
Updated by Gerrit Code Review about 9 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
Updated by Christian Hernmarck about 9 years ago
Uh - first patch comitted....
hope it's ok (sorry for the long lines in the msg).
Please write if something has to be doen...
/Ch
Updated by Gerrit Code Review about 9 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
Updated by Björn Jacob almost 9 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!
Updated by Gerrit Code Review almost 9 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
Updated by Björn Jacob almost 9 years ago
- Assignee changed from Christian Hernmarck to Ralf Zimmermann
Updated by Björn Jacob almost 9 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 }
Updated by Ralf Zimmermann almost 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 49ec453b448753b488685bfbf1f7af810fca62cf.