You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create simple form with a field which is marked as sender email
Now fill out form in FE and use a wrong email address
Expected result: After sending the form, I would expect an error message.
Actual result: no error message, only log message in error log (logging framework)
I do have a log message, so I know an exception is thrown:
Tue, 13 Aug 2024 15:31:18 +0200 [CRITICAL] request="97db7bed8235d" component="In2code.Powermail.Controller.FormController": Mail could not be sent - {"0":"Expected response code \"250/251/252\" but got code \"550\", with message \"550 5.1.1 <fehlerhafte-email@whatever-this-is-wrong.de>... User unknown\".","url":"https://mysite.de/test/powermail/powermail-einfaches-formular_intranet?tx_powermail_pi1%5Baction%5D=checkCreate&tx_powermail_pi1%5Bcontroller%5D=Form&cHash=ff72d9da8605e047124607eb4cc8e6c1"}
Possible fix
Fix in FormController:sendMailPreflight
} catch (Throwable $exception) {
$logger = ObjectUtility::getLogger(__CLASS__);
$logger->critical('Mail could not be sent', [$exception->getMessage()]);
+ $this->addFlashMessage(
+ LocalizationUtility::translate('error_mail_not_created'),
+ '',
+ \TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR
+ );
+ $this->messageClass = 'error';
}
(ideally a more specific message would be displayed - we know email sending failed and we could even differentiate between mail to sender and mail to receiver.)
Versions
TYPO3 12.4.18
powermail (latest release): 12.3.5
The text was updated successfully, but these errors were encountered:
Additionally: Ideally a more specific message would be displayed - we know email sending failed and we could even differentiate between mail to sender and mail to receiver.
sypets
changed the title
Flash message showing error is not submitted if sending of email fails
Flash message showing error is not submitted if sending of email fails (in case of exception)
Aug 13, 2024
This is related to #1087, but not the same issue. In fact, to solve #1087 I am using a patched version.
Reproduce
I do have a log message, so I know an exception is thrown:
Tue, 13 Aug 2024 15:31:18 +0200 [CRITICAL] request="97db7bed8235d" component="In2code.Powermail.Controller.FormController": Mail could not be sent - {"0":"Expected response code \"250/251/252\" but got code \"550\", with message \"550 5.1.1 <fehlerhafte-email@whatever-this-is-wrong.de>... User unknown\".","url":"https://mysite.de/test/powermail/powermail-einfaches-formular_intranet?tx_powermail_pi1%5Baction%5D=checkCreate&tx_powermail_pi1%5Bcontroller%5D=Form&cHash=ff72d9da8605e047124607eb4cc8e6c1"}
Possible fix
Fix in FormController:sendMailPreflight
https://github.com/in2code-de/powermail/blob/master/Classes/Controller/FormController.php#L394
(ideally a more specific message would be displayed - we know email sending failed and we could even differentiate between mail to sender and mail to receiver.)
Versions
The text was updated successfully, but these errors were encountered: