function efx_auto_subscribe_usergroup( $new_status, $old_status, $post ) {
global $edit_flow;
// Choose the slug for whichever status you'd like to auto-subscribe on
if ( 'story-idea' == $new_status ) {
// You'll need to get term IDs for your user groups and place them as
// comma-separated values
$usergroup_ids_to_follow = array( 90
// 88,
);
$edit_flow->notifications->follow_post_usergroups( $post->ID, $usergroup_ids_to_follow, true );
}
if ( 'assigned' == $new_status ) {
$edit_flow->notifications->follow_post_usergroups( $post->ID, 0, false );
// You'll need to get term IDs for your user groups and place them as
// comma-separated values
$usergroup_ids_to_follow = array( 88
// 88,
);
$edit_flow->notifications->follow_post_usergroups( $post->ID, $usergroup_ids_to_follow, true );
}
// Return true to send the email notification
return true;
}
add_filter( 'ef_notification_status_change', 'efx_auto_subscribe_usergroup', 10, 3 );