Hello everybody,
I'm building a subscription plugin, as of now it's capable of sending an email every time a new blog post is added, but that slows down the publishing of new posts since WP has to wait for my plugin to send an email to every subscriber.
I thought I could build a queue and work on it using wp_cron.. do you think this would be feasible??
Can you suggest some way to build it?? I don't need the actual code, just a few hints on how to implement the whole queue system..
I designed this plugin to have an entry in the options table with an array filled with those email address that verified their subscription, something like this:
but in its actual state, my code iterates through this array and sends an email when the new_to_publish action is fired.PHP Code:Array
(
[0] => "some.email@example.com",
[1] => "some.other@example.com",
[2] => "someone@example.com"
);
What I would like to do is make the actual sending of the email with a wp_cron job, and optionally split the queue in small sub queues so that the overhead on the webserver is not too heavy..
Thanks a lot for your help.. :)


LinkBack URL
About LinkBacks
Reply With Quote




