Hey James,
Sorry for the late reply, the MODX forum didn't notify me of your message. When you check out the core class on line #895 in the current release, you can see how I create a plugin reference.
$this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->_logger));
Your example would simply be revamped like so:
//Rate limit to 100 emails per-minute
$modx->mail->mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin(
100, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE
));
//Rate limit to 10MB per-minute
$modx->mail->mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin(
1024 * 1024 * 10, Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE
));
Haven't tried it, but that should work! Let me know!
Also, Swift Mailer has only a couple of native plugins, which you can enable via my own class like so:
$modx->mail->plugin(throttler', array(
'active' => false,
'rate' => 100,
'mode' => 'messages' // toggle 'bytes' for Bytes ;) Do yehr own calculation
)
));
That should work!
[ed. note: ReSpawN last edited this post 12 years, 5 months ago.]