Migrate to t3lib_htmlmail to SwiftMailer
We have a new Mailer API in 4.5 based on SwiftMailer and we want to deprecate the use of t3lib_htmlmail. Which means we need to get rid of it all together.
Attached is an untested patch of what this would mean more or less for "linkvalidator". Please take a look at it, test it, and integrate that solution for the RC1 if possible.
See pending documentation at http://wiki.typo3.org/Pending_Documentation#t3lib_mail
Updated by Michael Miousse over 10 years ago
- File linkvalidator-swiftmailer_v2.diff linkvalidator-swiftmailer_v2.diff added
- Status changed from New to Needs Feedback
Here is a tested version 2 of the patch with validations and error messages.
Need someone to double check the messages and double test it.
Updated by Chris topher over 10 years ago
Looks good. I did some reformatting of the code and changed some texts.
If everything is OK, you can commit this one.
We will also have to update the manual. I will then take care of that after the commit.
Updated by Ernesto Baschny over 10 years ago
About this snippet(s):
$failure = t3lib_div::makeInstance( 'Exception', $GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/locallang.xml:tasks.error.invalidFromEmail'), t3lib_FlashMessage::ERROR ); throw $failure; $sendEmail = FALSE;
1) throughout the core we usually use "throw new Exception()" syntax (no t3lib_div::makeInstance and no variable holding the exception before throwing it. Reasoning is that an exception should be thrown without relying on any other classes.
2) The second parameter of the Exception is not the FlashMessage Error-Code, but a unique unix timestamp (the time when you created the error message), so that we can differenciate different exceptions later on based on that information.
3) $sendEmail is never reached, so can also be removed (its shown as a "warning" in PhpStorm)
Could you adapt that still? Thanks!