Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author cojennin

    (@comradefuzz)

    Hrm, not sure what’s going on.

    I created the following plugin you can find at this gist: https://gist.github.com/cojennin/45ac4c91d6319f8f51060a5320d28f86

    I installed, then tried the following steps:

    1. As an Admin user, I assigned a user to the “Reporters” usergroup
    2. I logged in as the user I assigned to the “Reporters” usergroup and created a post
    3. I saved the post with status “Pitch”
    4. I set the post’s status to “Pending Review” and then saved the post again
    5. The “Reporters” usergroup was automatically subscribed to the post after I clicked save

    Are those the same steps you took?

    Thread Starter Daniele

    (@dabesa)

    Hi Cojennin,

    When you talk about usergroup, are you referring to WordPress user roles, or to the Edit Flow Groups feature?

    Our use case is this:
    We have 4 WordPress users with Author role.

    When a user (any user) set a post to ‘pending review’, we’d like the 4 authors to get a notification.

    Thanks

    Plugin Author cojennin

    (@comradefuzz)

    Ah, gotcha.

    Edited the gist: https://gist.github.com/cojennin/45ac4c91d6319f8f51060a5320d28f86

    That should subscribe all users with the WordPress role of ‘editor’ to the post being saved as pending. Want to give it a test?

    Misunderstood what you were trying to do. You were close with your code snippet, just need to use save_post_following_users instead of follow_post_usergroups since you want to follow WordPress roles.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Email Nofitication based on roles’ is closed to new replies.