ameos / ameos_mailredirect Goto Github PK
View Code? Open in Web Editor NEWMail redirection for developper in TYPO3.
License: GNU General Public License v2.0
Mail redirection for developper in TYPO3.
License: GNU General Public License v2.0
Hi, currently your extension is not working with form framework email finishers when fluid mails are enabled.
In this case:
https://github.com/TYPO3/typo3/blob/v11.5.10/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php#L194
the send method of the mailer class is called directly, so your provided xclasses will not fire at all.
I am using TYPO3 11.
Is it possible to xclass the Mailer-Class itself? Then maybe your other xclasses are not required anymore. A better approach could also be a PSR-14 event: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Events/Events/Core/Mail/AfterMailerInitializationEvent.html, but this will work only for TYPO3 11+ then.
What do you think?
Hi, can you please update the PHP version constraint inside ext_emconf.php? :)
The current value inside ext_emconf.php does not match the constraint inside composer.json.
ext_emconf.php
'php' => '5.5.0-7.3.99'
composer.json
"php": ">=7.0.0"
Thank you in advance :)
Relates to #9
While the mail redirection seems to work properly, the information about the replaced recipients is not added to the mailtext.
It looks like the body is rendered multiple times and thus overwrites the added information
I added some debug information to the generateTemplateBody method in FluidMail (in T3 11.5)
protected function generateTemplatedBody(string $forceFormat = ''): void
{
echo "<pre>";
\debug_print_backtrace(0, 8);
echo "</pre>";
This results in 3 renderings in my local ddev setup with smtp mailer / mailhog, but only the first one is from the xclassed mailer
#0 /var/www/html/src/public/typo3/sysext/core/Classes/Mail/FluidEmail.php(137): TYPO3\CMS\Core\Mail\FluidEmail->generateTemplatedBody()
#1 /var/www/html/src/vendor/symfony/mailer/SentMessage.php(33): TYPO3\CMS\Core\Mail\FluidEmail->ensureValidity()
#2 /var/www/html/src/vendor/symfony/mailer/Transport/AbstractTransport.php(70): Symfony\Component\Mailer\SentMessage->__construct(Object(TYPO3\CMS\Core\Mail\FluidEmail), Object(Symfony\Component\Mailer\DelayedEnvelope))
#3 /var/www/html/src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(136): Symfony\Component\Mailer\Transport\AbstractTransport->send(Object(TYPO3\CMS\Core\Mail\FluidEmail), Object(Symfony\Component\Mailer\DelayedEnvelope))
#4 /var/www/html/src/public/typo3/sysext/core/Classes/Mail/Mailer.php(125): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->send(Object(TYPO3\CMS\Core\Mail\FluidEmail), NULL)
#5 /var/www/html/src/public/typo3conf/ext/ameos_mailredirect/Classes/Xclass/Mail/Mailer.php(68): TYPO3\CMS\Core\Mail\Mailer->send(Object(TYPO3\CMS\Core\Mail\FluidEmail), NULL)
#6 /var/www/html/src/public/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php(194): Ameos\AmeosMailredirect\Xclass\Mail\Mailer->send(Object(TYPO3\CMS\Core\Mail\FluidEmail))
#7 /var/www/html/src/public/typo3/sysext/form/Classes/Domain/Finishers/AbstractFinisher.php(156): TYPO3\CMS\Form\Domain\Finishers\EmailFinisher->executeInternal()
#0 /var/www/html/src/public/typo3/sysext/core/Classes/Mail/FluidEmail.php(143): TYPO3\CMS\Core\Mail\FluidEmail->generateTemplatedBody()
#1 /var/www/html/src/vendor/symfony/mime/Message.php(117): TYPO3\CMS\Core\Mail\FluidEmail->getBody()
#2 /var/www/html/src/vendor/symfony/mime/RawMessage.php(52): Symfony\Component\Mime\Message->toIterable()
#3 /var/www/html/src/vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php(112): Symfony\Component\Mime\RawMessage->toIterable()
#4 /var/www/html/src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(207): Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream::replace('\r\n.', '\r\n..', Object(Generator))
#5 /var/www/html/src/vendor/symfony/mailer/Transport/AbstractTransport.php(71): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->doSend(Object(Symfony\Component\Mailer\SentMessage))
#6 /var/www/html/src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(136): Symfony\Component\Mailer\Transport\AbstractTransport->send(Object(Symfony\Component\Mailer\SentMessage), Object(Symfony\Component\Mailer\DelayedEnvelope))
#7 /var/www/html/src/public/typo3/sysext/core/Classes/Mail/Mailer.php(125): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->send(Object(TYPO3\CMS\Core\Mail\FluidEmail), NULL)
#0 /var/www/html/src/public/typo3/sysext/core/Classes/Mail/FluidEmail.php(137): TYPO3\CMS\Core\Mail\FluidEmail->generateTemplatedBody()
#1 /var/www/html/src/vendor/symfony/mime/Email.php(464): TYPO3\CMS\Core\Mail\FluidEmail->ensureValidity()
#2 /var/www/html/src/vendor/symfony/mime/Email.php(426): Symfony\Component\Mime\Email->generateBody()
#3 /var/www/html/src/public/typo3/sysext/core/Classes/Mail/FluidEmail.php(145): Symfony\Component\Mime\Email->getBody()
#4 /var/www/html/src/vendor/symfony/mime/Message.php(117): TYPO3\CMS\Core\Mail\FluidEmail->getBody()
#5 /var/www/html/src/vendor/symfony/mime/RawMessage.php(52): Symfony\Component\Mime\Message->toIterable()
#6 /var/www/html/src/vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php(112): Symfony\Component\Mime\RawMessage->toIterable()
#7 /var/www/html/src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(207): Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream::replace('\r\n.', '\r\n..', Object(Generator))
Seems like Xclassing MailMessage and FluidMail is still required?
Since TYPO3 10 is supported, please consider to also raise the PHP-limit.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.