Issue Feature Closed

#71982Mail From mutli recipient from select list option

bogdanovic no-lastname-given 11/30/15, 13:07 updated 11/30/15, 14:09

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);
                }
        }

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.