Using the Verbose Sending plugin Swift 3

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Using the Verbose Sending plugin Swift 3

Post by RobertGonzalez »

Everah | Split from viewtopic.php?p=355652#355652
d11wtq wrote:Try the plugin in this thread: viewtopic.php?p=301240#301240

:)
Does anyone know how to implemented the linked to plug in for PHP5 on Swift V3?
Last edited by RobertGonzalez on Sun Mar 18, 2007 9:16 am, edited 2 times in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You don't really need it, just don't use batchSend(). If you use a loop you can get the return value from each send anyway. However, if you want to write a plugin it should be a lot more logical than it was with the old API.

I started but I'm too drunk to code sorry... I was actually just about to fall into bed when I spotted your post 8O

I'll finish this tomorrow, but if you were feeling enthusiastic here's the head-start :P

Code: Select all

class Swift_Plugin_VerboseSending implements Swift_Events_SendListener
{
	public function sendPerformed(Swift_Events_SendEvent $e)
	{
		$num_sent = $e->getNumSent();
		$recipients = $e->getRecipients();
		//Bleh... too drunk... my eyes have gone all fuzzy...
	}
}
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I should have posted back... I went with a foreach (it was only 30 mails) and it worked fine. I actually ported some of that echo code into the foreach loop and it had the same effect.

Thanks for the post though d11. I may look at writing that plug in just do I can familiarize myself with the process.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Everah wrote:I should have posted back... I went with a foreach (it was only 30 mails) and it worked fine. I actually ported some of that echo code into the foreach loop and it had the same effect.

Thanks for the post though d11. I may look at writing that plug in just do I can familiarize myself with the process.
I'm actually modifying what goes in SendEvent now... I'm adding getFailedRecipients() to the event because it's useful to have easy access to. The version you have will require a bit of a workaround to identify who the failures are in a list.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Cool. Do you plan on making that plugin part of the core package?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I'll make as many plugins as I can if people fnd them useful :)

The next ones that will appear are throttlers and message customization plugins.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

This now in subversion and the View has been abstracted so you can change the way it's displayed.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Post Reply