[TYPO3-dev] Feedback for #13698 - Add proxy for the mail() function
Oliver Klee
typo3-german-02 at oliverklee.de
Mon Mar 8 18:57:49 CET 2010
Hi,
Tolleiv Nietsch schrieb:
> a) have a proxy function on his own which is used by t3lib_htmlmail and
> plainMailEncoded
Yes, this is the way to go.
To make proper unit testing possible, this function shouldn't be called
statically, but use a mailer instance which can be overwritten.
In the oelib extension, we've done that:
tx_oelib_abstractMailer, tx_oelib_realMailer, tx_oelib_emailCollector,
tx_oelib_mailerFactory
One note: Nowadays, I think that the use of a factory and the strategy
pattern is overkill for this. I'd go for a solution like this:
- mailer::send etc.
- mailer::getInstance & setInstance
- testingMailer extends mailer
> b) refactor t3lib_htmlmail to use plainMailEncoded
We tried something similar as well (using plainMailEncoded to send our
HTML e-mails), but some plain-text specific stuff is hardcoded in
plainMailEncoded, so this won't really work.
Oli
--
Certified TYPO3 Integrator | TYPO3 Security Team Member
More information about the TYPO3-dev
mailing list