Closed andre-spindler closed 3 years ago
The current initialization of the MailFinisher results in an exception when submitting the form and sending the mail.
In TYPO3 v10 the "single definition" of mail recipients was declared as deprecated, in v11 it was removed now: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.0/Deprecation-80420-EmailFinisherSingleAddressOptions.html
Therefore the initialization should be changed. Old (v10): form->createFinisher('EmailToReceiver', [ 'subject' => $settings['suggest']['notification']['subject'] ?? '', 'recipientAddress' => $settings['suggest']['notification']['recipientAddress'] ?? '', 'recipientName' => $settings['suggest']['notification']['recipientName'] ?? '', 'senderAddress' => $settings['suggest']['notification']['senderAddress'] ?? '', 'senderName' => $settings['suggest']['notification']['senderName'] ?? '', 'carbonCopyAddress' => $settings['suggest']['notification']['carbonCopyAddress'] ?? '', 'blindCarbonCopyAddress' => $settings['suggest']['notification']['blindCarbonCopyAddress'] ?? '', 'format' => 'html' ]);
form->createFinisher('EmailToReceiver', [ 'subject' => $settings['suggest']['notification']['subject'] ?? '', 'recipientAddress' => $settings['suggest']['notification']['recipientAddress'] ?? '', 'recipientName' => $settings['suggest']['notification']['recipientName'] ?? '', 'senderAddress' => $settings['suggest']['notification']['senderAddress'] ?? '', 'senderName' => $settings['suggest']['notification']['senderName'] ?? '', 'carbonCopyAddress' => $settings['suggest']['notification']['carbonCopyAddress'] ?? '', 'blindCarbonCopyAddress' => $settings['suggest']['notification']['blindCarbonCopyAddress'] ?? '', 'format' => 'html' ]);
New (v11): $form->createFinisher('EmailToReceiver', [ 'subject' => $settings['suggest']['notification']['subject'] ?? '', 'recipients' => $settings['suggest']['notification']['recipientAddress'] ? [ $settings['suggest']['notification']['recipientAddress'] => $settings['suggest']['notification']['recipientName'], ] : [], 'senderAddress' => $settings['suggest']['notification']['senderAddress'] ?? '', 'senderName' => $settings['suggest']['notification']['senderName'] ?? '', 'carbonCopyAddress' => $settings['suggest']['notification']['carbonCopyAddress'] ?? '', 'blindCarbonCopyAddress' => $settings['suggest']['notification']['blindCarbonCopyAddress'] ?? '', 'format' => 'html' ]); (Sorry - line breaks an indents in the editor are removed in preview and final issue. See screenshots below)
$form->createFinisher('EmailToReceiver', [ 'subject' => $settings['suggest']['notification']['subject'] ?? '', 'recipients' => $settings['suggest']['notification']['recipientAddress'] ? [ $settings['suggest']['notification']['recipientAddress'] => $settings['suggest']['notification']['recipientName'], ] : [], 'senderAddress' => $settings['suggest']['notification']['senderAddress'] ?? '', 'senderName' => $settings['suggest']['notification']['senderName'] ?? '', 'carbonCopyAddress' => $settings['suggest']['notification']['carbonCopyAddress'] ?? '', 'blindCarbonCopyAddress' => $settings['suggest']['notification']['blindCarbonCopyAddress'] ?? '', 'format' => 'html' ]);
In the above code I kept the sionge definition in typoscript. Perhaps this can (should?) changed also to allow multiple recipients.
For our use case, we are already using a custom form factory, as we need a different setup of form fields anyway.
PHP: 7.4 TYPO3: 11.2.0 EXT:sessionplaner: 4.0.0
Screenshot v10:
Screenshot v11:
Please push a PR which covers the needed changes.
The current initialization of the MailFinisher results in an exception when submitting the form and sending the mail.
In TYPO3 v10 the "single definition" of mail recipients was declared as deprecated, in v11 it was removed now: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.0/Deprecation-80420-EmailFinisherSingleAddressOptions.html
Therefore the initialization should be changed. Old (v10):
form->createFinisher('EmailToReceiver', [ 'subject' => $settings['suggest']['notification']['subject'] ?? '', 'recipientAddress' => $settings['suggest']['notification']['recipientAddress'] ?? '', 'recipientName' => $settings['suggest']['notification']['recipientName'] ?? '', 'senderAddress' => $settings['suggest']['notification']['senderAddress'] ?? '', 'senderName' => $settings['suggest']['notification']['senderName'] ?? '', 'carbonCopyAddress' => $settings['suggest']['notification']['carbonCopyAddress'] ?? '', 'blindCarbonCopyAddress' => $settings['suggest']['notification']['blindCarbonCopyAddress'] ?? '', 'format' => 'html' ]);
New (v11):
$form->createFinisher('EmailToReceiver', [ 'subject' => $settings['suggest']['notification']['subject'] ?? '', 'recipients' => $settings['suggest']['notification']['recipientAddress'] ? [ $settings['suggest']['notification']['recipientAddress'] => $settings['suggest']['notification']['recipientName'], ] : [], 'senderAddress' => $settings['suggest']['notification']['senderAddress'] ?? '', 'senderName' => $settings['suggest']['notification']['senderName'] ?? '', 'carbonCopyAddress' => $settings['suggest']['notification']['carbonCopyAddress'] ?? '', 'blindCarbonCopyAddress' => $settings['suggest']['notification']['blindCarbonCopyAddress'] ?? '', 'format' => 'html' ]);
(Sorry - line breaks an indents in the editor are removed in preview and final issue. See screenshots below)In the above code I kept the sionge definition in typoscript. Perhaps this can (should?) changed also to allow multiple recipients.
For our use case, we are already using a custom form factory, as we need a different setup of form fields anyway.
PHP: 7.4 TYPO3: 11.2.0 EXT:sessionplaner: 4.0.0
Screenshot v10:
Screenshot v11: