cake-php@googlegroups.com
[Top] [All Lists]

Re: Advice for personalized email (i.e. newsletter, mass email)

Subject: Re: Advice for personalized email i.e. newsletter, mass email
From: LunarDraco
Date: Fri, 16 Apr 2010 09:51:05 -0700 PDT
tcornett,

Swift Mailer handles persistent connections. It also handles
throttling and secure connections to smtp.

I've yet to find a component/plugin/behavior that wraps swift mailer
or any other mailer in a way that takes advantage of persistent
connections and throttling features. However the Component is fairly
short and might be a good starting point to just re-write in a
function that can handle the looping while in one connection.
I've written a task which i call from a background queue that uses the
swiftmailer component. And swiftmailer is very complete and simple to
use. From my app I add a bunch of task to the queue. Then in the
background those task are pulled and processed. Each of my email
templates use a variable replacement where I can do a preg_replace
looking for patterns like {placeholder} and inject to that placeholder
new content. Currently i'm making a new connection for each email
using the swiftmailer component.

This has been sufficient for my needs up to this point, but I may have
to visit this issue sooner than later.
The component needs to be updated to make use of the persistent
connection and throttling. But this may be a good start for you. The
component does have a couple CallBacks, but I think it would need to
be augmented with a singleton reference to the active SwiftMailer
Object then you could easily check if a connection was already open
and continue to use it.

Queue background processing:
http://github.com/MSeven/cakephp_queue

SwiftMailer:
http://swiftmailer.org/

SwiftMailer Component:
http://bakery.cakephp.org/articles/view/updated-swiftmailer-4-xx-component-with-attachments-and-plugins

On Apr 15, 4:36 pm, tcornett <tcorn...@xxxxxxxxx> wrote:
> I am looking to setup an aspect of my cakephp application to handle
> the emailing of a large number of individuals with a personalized
> email message. [THIS IS NOT FOR SPAM]  I have been looking around and
> I cant really seem to find anything that handles this situation well.
>
> A couple of the major roadblocks that I have run into are :
>  1) Persistent connection with the SMTP server.  Instead of connecting
> for one message, I need to be able to connect, send X emails, and then
> disconnect.  There does not seem to be anything out there for this
> type of behavior
>  2) The need for personalization in each email.  It can not be 1 email
> with 50 recipients.  It would end up being 50 emails each with
> different information in the body of the email.
>  3) Request timeout - If I try to send them all at once, the request
> will time out.  I would rather have a setup where an automated process
> picks up the email and sends them.
>
> I have looked into CRON jobs based solutions, found basic queue and
> deferring processing techniques but nothing really handles this
> situation, IMHO is a pretty basic problem for any application with
> users.  I know I am basically building a mailing list manager but it
> is just going to be one aspect of the app.
>
> Does anyone have any directions to point me in or ideas for solutions?
>
> Thanks in advance for any help.
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

<Prev in Thread] Current Thread [Next in Thread>