Project

General

Profile

Actions

Bug #32950

closed

EXT:form - Confirmation mail to sender in FORM

Added by Einar Gislason about 12 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2012-01-03
Due date:
% Done:

0%

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

Description

It appears that it is not possible to send a confirmation mail to the sender of a form in the the FORM extension.
It is possible to set sender name and email via senderEmailField and senderNameField respectively, but it would be nice if there was a possibility to send a confirmation mail to that user as well. This could be defined with senderConfirmEmail or something similar.


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 Roland Schoenmakers about 11 years ago

  • Assignee set to Ernesto Baschny

Einar Gislason wrote:

It appears that it is not possible to send a confirmation mail to the sender of a form in the the FORM extension.
It is possible to set sender name and email via senderEmailField and senderNameField respectively, but it would be nice if there was a possibility to send a confirmation mail to that user as well. This could be defined with senderConfirmEmail or something similar.

Why has this request no follow-up yet...?

Actions #2

Updated by Stefan Neufeind about 11 years ago

Since sending an email is just calling a mail-postprocessor, can't we just call another mail-postproc to send email to the user? This way you could also use a separate email-template etc.

Actions #3

Updated by Ernesto Baschny over 10 years ago

  • Status changed from New to Accepted
  • Assignee deleted (Ernesto Baschny)
  • Priority changed from Should have to Could have

Sounds like a good idea, but why is that assigned to me? :)

Einar, do you have some time to implement this feature? Or anyone else?

Actions #4

Updated by Einar Gislason over 10 years ago

I don't have time right now... :(

Actions #5

Updated by Bernhard Eckl about 10 years ago

Bump!

Maybe this is interesting, the postprocessor mail was replaced there by custom php which is also available there for download: http://alumnitypo3.blogspot.de/2012/01/form-einfaches-nachrichtensystem-fur.html

In my opinion it would be great to have a checkbox to send a confirmation page so that editors can easily select it and don’t have to know typoscript post processors (also a checkbox for the confirmation page would be good for editors). Would be great for T3 6.2! :-)

Actions #6

Updated by Mathias Schreiber about 9 years ago

  • Target version set to 7.5
Actions #7

Updated by Björn Jacob over 8 years ago

  • Category changed from Form Framework to 1602
Actions #8

Updated by Björn Jacob over 8 years ago

  • Category changed from 1602 to Form Framework
Actions #9

Updated by Björn Jacob over 8 years ago

  • Status changed from Accepted to Needs Feedback
  • Assignee set to Einar Gislason

To be honest I don't understand what you guys want to achieve. Would #68771 suit your needs?

Actions #10

Updated by Benni Mack over 8 years ago

  • Target version deleted (7.5)
Actions #11

Updated by Björn Jacob over 8 years ago

  • Status changed from Needs Feedback to New
  • Assignee deleted (Einar Gislason)
  • Parent task set to #69410

Since there is no feedback I'll keep this issue open as a new feature for v8. As far as I understand the idea of this issue, there should be a postProcessor which sends automatically a confirmation email. The email states that the mail of the sender has been generated and sent to the receiver.

Actions #12

Updated by Björn Jacob about 8 years ago

  • Parent task deleted (#69410)
Actions #13

Updated by Stephan Großberndt about 8 years ago

When you fill you a form with lots of data, supply your E-Mail-Address and send it, you are set in CC of the mail and get a copy so you can prove you actually sent it.

Actions #15

Updated by Stephan Großberndt about 8 years ago

In TYPO3 6.2 this is not possible to achieve with TypoScript, you need a own MailPostProcessor:

Vendor\Extension\Form\CcMailPostProcessor.php:

namespace Vendor\Extension\Form;

use TYPO3\CMS\Form\PostProcess\MailPostProcessor;

/**
 * Ein MailPostProcessor für TYPO3 CMS 6.2, der die E-Mail als CC an den Absender schickt
 * Ab TYPO3 CMS 7.6 ist folgendes möglich und dieser MailPostProcessor nicht mehr nötig:
 *
 * ccEmail = TEXT
 * ccEmail.data = GP:tx_form_form|tx_form|email
 *
 */
class CcMailPostProcessor extends MailPostProcessor {

    /**
     * Constructor
     *
     * @param \TYPO3\CMS\Form\Domain\Model\Form $form Form domain model
     * @param array $typoScript Post processor TypoScript settings
     */
    public function __construct(\TYPO3\CMS\Form\Domain\Model\Form $form, array $typoScript) {
        parent::__construct($form, $typoScript);
        if ($this->requestHandler->has($this->typoScript['senderEmailField'])) {
            $this->typoScript['ccEmail'] .= (!empty($this->typoScript['ccEmail']) ? ',' : '') . $this->requestHandler->get($this->typoScript['senderEmailField']);
        }
    }

}

Use it in your form:

postProcessor {
    1 = Vendor\Extension\Form\CcMailPostProcessor

From TYPO3 CMS 7.6 you can do the following in the TypoScript and do not need a MailPostProcessor:

ccEmail = TEXT
ccEmail.data = GP:tx_form_form|tx_form|email
ccEmail.data.htmlspecialchars = 1

Replace email with your email-field name.

Please make sure you have a captcha or honeypot to protect the form - otherwise this can be used to send automated SPAM!

Actions #16

Updated by Björn Jacob about 8 years ago

Thx Stephan. We'll add the TS solution and the hints to the documentation. As discussed on Slack, there is no need for any programming.

Actions #17

Updated by Björn Jacob almost 8 years ago

  • Subject changed from Confirmation mail to sender in FORM to EXT:form - Confirmation mail to sender in FORM
  • Status changed from New to Closed

On my list for documentation.

Actions #18

Updated by Adrien Jacob over 7 years ago

  • Tracker changed from Feature to Bug
  • TYPO3 Version set to 7
  • PHP Version set to 7.0
  • Is Regression set to No

Sorry to reopen this ticket, but I spent a lot of time trying to find a possible mistake on my side and didn't find it, so here is my problem : I tried dynamically changing the recipientEmail value(as explained in this ticket for ccEmail, but I tried all other recipient fields), and it always ends up with "There was an error when sending the form by mail". It works ok if I set a fixed value instead. I did add the Default TS, called after bootstrap_package.

Here is the code used in the form :

enctype = multipart/form-data
method = post
prefix = tx_form
confirmation = 
postProcessor {
    1 = mail
    1 {
        recipientEmail = TEXT
        recipientEmail {
            data = GP:tx_form_form|tx_form|email
            htmlSpecialChars = 1
        }
        senderEmail = test@example.com
        subject = Title
    }
}
10 = TEXTLINE
10 {
    type = email
    name = email
    label {
        value = Email
    }
}
20 = SUBMIT
20 {
    type = submit
    name = 5
    value = Send
}

Thanks in advance !

Actions #19

Updated by Adrien Jacob over 7 years ago

Sorry, I finally understood from the other related ticket that I had to use typoscript, and not the Form wizard... You may close the ticket (again).

Actions #20

Updated by Björn Jacob over 7 years ago

Thank you for your feedback and great that you found a solution.

Actions

Also available in: Atom PDF