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
Using the event "SendMailServicePrepareAndSendEvent" it is possible to change the mail object and also to prevent the sending of an email (receiver and/or sender).
This works without any problem, but in the frontend an error is shown (flash message), informing the website customer that an email could not be sent in addition (!) to the normal "thank you" message ("settings.flexform.thx.body").
We are considering to use this event in order to disable the sending of emails on a case-by-case basis using the isAllowedToSend() call with "false" as a parameter.
I would suggest to change the prepareAndSend() function, so that it returns true instead of false, if the if-condition "isAllowedToSend" is false.
That should suppress the flash/error message, if the mail was not sent, because explicitly disabling the sending of emails should not be treated as an error.
TYPO3 12.4.26 (legacy, not composer)
powermail 12.5.1
PHP 8.2