Skip to content

Instantly share code, notes, and snippets.

@radmiraal
Last active December 12, 2015 02:49
Show Gist options
  • Save radmiraal/4702373 to your computer and use it in GitHub Desktop.
Save radmiraal/4702373 to your computer and use it in GitHub Desktop.
A completely untested possible way of registering plugins in swift
<?php
class CommandController {
$mail = t3lib_div::makeInstance('MyOwnCustomMailMessageObject');
}
?>
<?php
class MyOwnCustomMailMessageObject extends t3lib_mail_Message {
private function initializeMailer() {
$this->mailer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\Mailer');
$this->mailer->registerPlugin(
t3lib_div::makeInstance('Swift_Plugins_AntiFloodPlugin', 100, 30), 'anti-flood'
);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment