Title: programatically updated post does not resend emails
Last modified: October 14, 2021

---

# programatically updated post does not resend emails

 *  Resolved [flymike](https://wordpress.org/support/users/flymike/)
 * (@flymike)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/programatically-updated-post-does-not-resend-emails/)
 * 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 4 years, 7 months ago by [flymike](https://wordpress.org/support/users/flymike/).
      Reason: clarify wp function calls

Viewing 1 replies (of 1 total)

 *  Thread Starter [flymike](https://wordpress.org/support/users/flymike/)
 * (@flymike)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/programatically-updated-post-does-not-resend-emails/#post-14972063)
 * 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)

The topic ‘programatically updated post does not resend emails’ is closed to new
replies.

 * ![](https://ps.w.org/subscribe2/assets/icon-256x256.png?rev=2318630)
 * [Subscribe2 - Form, Email Subscribers & Newsletters](https://wordpress.org/plugins/subscribe2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/subscribe2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/subscribe2/)
 * [Active Topics](https://wordpress.org/support/plugin/subscribe2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/subscribe2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/subscribe2/reviews/)

## Tags

 * [update](https://wordpress.org/support/topic-tag/update/)

 * 1 reply
 * 1 participant
 * Last reply from: [flymike](https://wordpress.org/support/users/flymike/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/programatically-updated-post-does-not-resend-emails/#post-14972063)
 * Status: resolved