Welcome Guest, Not a member yet? Register   Sign In
Asynchronous Email
#1

[eluser]Shouvik-S-Mazumdar[/eluser]
I am not sure if this is the correct forum to ask this question.

I want to send email asynchronously. The scenario is , when the user posts a blog , i want to send an email notifications to the users friendlist , which might contain any number of friends ( more than 100 )

I want this email service happeninng in the background , so that the user doesnt need to wait till the server sends all the email ( i might implement flow control in the future )

Is that possible ?

PS : will using ajax solve this problem ?
#2

[eluser]InsiteFX[/eluser]
Then you would want to use a cron job and an autoresponder.

InsiteFX
#3

[eluser]Shouvik-S-Mazumdar[/eluser]
Can anyone explain me the process or direct me to a link which does the same
#4

[eluser]WanWizard[/eluser]
Search for cron here, there are some excellent things written about it.

I use a workflow engine to do these kind of things, which basically works with a message queue which is processed sequentially in the background. Which is a system you could use as well.

My message queue table is filled after inserting a record (in your case a new blog record), and contains (amongst other things) the controller and method name to execute, the table name, and the key fields of the record inserted. My cron controller (a CLI process) reads the message queue, calls the controller/method with the table name and key fields as parameter, and removes the message from the queue when finished. The controller/method is specific for the task to perform, and should know what to do with the parameters received (in this case, retrieve the friends list and start mailing).

This runs completely independent of the interactive part of the site.




Theme © iAndrew 2016 - Forum software by © MyBB