Results 1 to 6 of 6

Thread: I need a few suggestions..

  1. #1
    danix's Avatar
    danix is offline Hello World
    Join Date
    Sep 2011
    Location
    London
    Posts
    25

    Icon5 I need a few suggestions..

    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:
    PHP Code:
    Array
    (
        [
    0] => "some.email@example.com",
        [
    1] => "some.other@example.com",
        [
    2] => "someone@example.com"
    ); 
    but in its actual state, my code iterates through this array and sends an email when the new_to_publish action is fired.

    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.. :)
    one day I will make a living out of WordPress...
    http://danixland.net | gpg-key: C4FAE66B | @danixland

  2. #2
    nbtetreault is offline Hello World
    Join Date
    Sep 2011
    Posts
    2

    Default

    Are you using wp_mail($to, $subject, $message, $headers, $attachments)
    to send your email? That function uses phpmailer class. It allow to
    use BCC. You need to add the BCC to the $header parameter.

    The string for BCC should be : "Bcc:
    some.email@example.com;some.other@example.com;someone@example.com" .
    PHP_EOL;

    Use your own email adress for $to.

  3. #3
    danix's Avatar
    danix is offline Hello World
    Join Date
    Sep 2011
    Location
    London
    Posts
    25

    Default

    Hi nbtetreault, thanks for replying..

    Yes, I'm using wp_mail() but no, I can't use this approach since I'm generating custom content for each email address (an unsubscription link), and so I can't simply add every address as bcc but I need to fetch them from the db one by one..

    Do you have any other idea??

    Thanks again..
    one day I will make a living out of WordPress...
    http://danixland.net | gpg-key: C4FAE66B | @danixland

  4. #4
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by danix View Post
    Hi nbtetreault, thanks for replying..

    Yes, I'm using wp_mail() but no, I can't use this approach since I'm generating custom content for each email address (an unsubscription link), and so I can't simply add every address as bcc but I need to fetch them from the db one by one..

    Do you have any other idea??

    Thanks again..
    I know next-to-nothing about email newsletter functionality from WordPress core, but my initial thought was: why not provide an interface to an existing email-subscription service, rather than try to reinvent the wheel within WordPress?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  5. #5
    danix's Avatar
    danix is offline Hello World
    Join Date
    Sep 2011
    Location
    London
    Posts
    25

    Default

    @chipbennett:
    I didn't think about that.. I'll have a look at how to integrate some services like mailchimp.. I hope this doesn't get too hard to do..

    Thanks a lot!!
    one day I will make a living out of WordPress...
    http://danixland.net | gpg-key: C4FAE66B | @danixland

  6. #6
    kovshenin's Avatar
    kovshenin is offline Hello World
    Join Date
    Sep 2011
    Location
    Moscow
    Posts
    14

    Default

    Feedburner provides out of the box RSS to E-mail support :)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •