Project

General

Profile

Actions

Feature #71982

closed

Mail From mutli recipient from select list option

Added by bogdanovic no-lastname-given over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2015-11-30
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

To enable the recipient to have a selection list for email, it's necessary to modify th setTo() function.
And and a recipientEmailField in TypoScript with a controller treatment based on setFrom() function.

typo3/sysext/form/Classes/PostProcess/MailPostProcessor.php (l 169)
        /**
         * Adds the receiver of the mail message when configured
         *
         * Checks the address if it is a valid email address
         *
         * @return void
         */
        protected function setTo() {
                $toEmails = '';
                if ($this->typoScript['recipientEmail']) {
                        $toEmails = $this->typoScript['recipientEmail'];
                } elseif ($this->requestHandler->has($this->typoScript['recipientEmailField'])) {
                        $toEmails = $this->requestHandler->get($this->typoScript['recipientEmailField']);
                } else {
                        $toEmails = $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'];
                }
                if (!\TYPO3\CMS\Core\Utility\GeneralUtility::validEmail($toEmails)) {
                        $toEmails = \TYPO3\CMS\Core\Utility\MailUtility::getSystemFromAddress();
                }

                $validEmails = $this->filterValidEmails($toEmails);
                if (count($validEmails)) {
                        $this->mailMessage->setTo($validEmails);
                }
        }

Actions

Also available in: Atom PDF