Feature #24841
closedDefining a custom MailTransport which implements SwiftTransport
100%
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
Updated by Claus Due almost 14 years ago
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.
Updated by Claus Due almost 14 years ago
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);
}
Updated by Ernesto Baschny almost 14 years ago
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.
Updated by Xavier Perseguers over 13 years ago
- Target version deleted (
4.6.0-beta1)
Updated by Gerrit Code Review almost 13 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7065
Updated by Jigal van Hemert almost 13 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 231fd60c3e8d8fb7c1ee582dcd42835ff97272ef.