Support » Plugin: Subscribe2 - Form, Email Subscribers & Newsletters » programatically updated post does not resend emails

  • Resolved flymike


    When a subscribed-to post is first published, its subscribers get an email. Subsequently, the same post can be returned to Draft status, updated, then (re)published – and subscribers will get another email.

    I’m trying to emulate the subsequent behavior programatically.

    That is, set post_status to Draft and revise content via wp_update_post, then set post_status to Publish and use wp_insert_post(same-post-id) to re-publish. But S2 doesn’t re-send the email to subscribers.

    I also tried wp_transition_post_status(‘draft’,’publish’) – but no emails sent either.

    How to make S2 send emails for a re-published post without resorting to manual manipulation of post?

    • This topic was modified 1 month, 1 week ago by flymike. Reason: clarify wp function calls
Viewing 1 replies (of 1 total)
  • Thread Starter flymike


    Answering my own question: the secret is wp_transition_post_status(’publish’, 'draft')

    Just have to get the parameters the right way round…

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.