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 #1

Updated by Björn Jacob over 8 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.

Actions #2

Updated by Christian Hernmarck over 8 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.

Actions #3

Updated by Björn Jacob over 8 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.

Actions #4

Updated by Gerrit Mohrmann over 8 years ago

For master the replyTo setting is in #68771

Actions #5

Updated by Christian Hernmarck over 8 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....

Actions #6

Updated by Wouter Wolters over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #7

Updated by Björn Jacob over 8 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.

Actions #8

Updated by Gerrit Code Review over 8 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

Actions #9

Updated by Christian Hernmarck over 8 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

Actions #10

Updated by Gerrit Code Review over 8 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

Actions #11

Updated by Björn Jacob over 8 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!

Actions #12

Updated by Gerrit Code Review over 8 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

Actions #13

Updated by Björn Jacob over 8 years ago

  • Assignee changed from Christian Hernmarck to Ralf Zimmermann
Actions #14

Updated by Björn Jacob over 8 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
}

Actions #15

Updated by Ralf Zimmermann over 8 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF