Feature #24841
closed
Defining a custom MailTransport which implements SwiftTransport
Added by Claus Due almost 14 years ago.
Updated about 6 years ago.
Description
Hi guys,
Wonderful work on 4.5 so far. I would like to request a feature (or rather behavior change) in the core mailer of TYPO3. I have attached a .diff file which changes the default case in the switch on $GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport'] to detect a user-specified extension class implementing SwiftTransport - which is then able to act as the default mail transport for TYPO3.
The default behavior in this patch is to throw an exception on an unknown transport definition - the default maybe should be to use the default TYPO3 transport as in case "mail".
This is as far as I can tell the way to go when replacing the basic way emails are sent, for example letting the administrator implement a SOAP-based offsite email sending solution; which is what I'm trying to do.
Patch created on 4.5rc2
(issue imported from #M17345)
Files
Note: this could possibly also be solved by using the provided custom transport name to override the default MailInvoker used by SwiftMailer - actually, that seems like a better solution. Attached is a .diff exploring that method.
Sorry for the corrections, but it appears I found a developer-friendlier way of doing this:
Before setting $this->transport, inside the default case:
$invokerClassName = $mailSettings['transport'];
if ($invokerClassName != 'mail') {
Swift_DependencyContainer::getInstance()->register('transport.mailinvoker')->asSharedInstanceOf($invokerClassName);
}
Very interesting feature! I guess we will have more t3lib_mail API enhancements for 4.6, and this is definitively one to consider.
Sorry that we didn't have time to include it in 4.5. But 4.6 will be out in October.
Consider opening a thread in the teams.projects.v4 newsgroup / mailing list about enhancing the t3lib_mail API! Jigal and myself will gladly join the discussion.
- Target version deleted (
4.6.0-beta1)
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF