Edit Flow
Auto-subscribe user groups for specific authors (2 posts)

  1. scottkarp
    Posted 4 years ago #

    Trying to set up auto-subscribe user groups for particular authors. Specifically, when a Contributor changes a post status from Draft to Pending Review, the user group with that Contributor's editor is auto-subscribed. Using the auto-subscribe mini framework, but this isn't working (no notification send to user group when post changed from Draft to Pending Review):

    if ( 'pending' == $new_status && '306' == $post->post_author ) {
    		$usergroup_ids_to_follow = array(

    What's the correct conditional statement?


  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 4 years ago #

    When you say "this isn't working", do you mean:

    • The usergroup isn't subscribed at all
    • The user group becomes subscribed, but the email notification isn't sent

    Also, can you confirm you have the follow_post_usergroups() call after you declare your values?

    $edit_flow->notifications->follow_post_usergroups( $post->ID, $usergroup_ids_to_follow, true );

    In either regard, can you add the following above your conditional check?

    var_dump( 'Status: ' . $new_status );
    var_dump( 'Author: ' . $post->post_author );

    This will give you some values we can check against the conditional

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Edit Flow
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic