|

Add additional notification emails

Sometimes it’s useful to have more than just project members and administrators to project receive notifications. The best way to do this is to add additional emails using the ph_project_emails filter. This filter runs for both mockup and website project actions (comments, approvals, etc) right before it sends the email. 

Here’s an example on how to use the filter. You would place this code in your theme or child theme’s functions.php file. In this example, we are subscribe all users with the Project Administrator role to get mockup and website updates via email:

<?php
/**
 * Add additional emails for project actions
 */
function wp_987_add_emails_from_role( $emails = array() ) {
  
    // get users with a specific role
	$users = get_users( array(
		// can also be project_editor, project_collaborator, project_client or a combo
		'role__in' => array( 'project_admin' ) 
	) );
	
	// add each user to the email list
	foreach ( $users as $user ) {
		$emails[] = $user->user_email;	
	}
	
	
	return $emails;
}
add_filter( 'ph_project_emails', 'wp_987_add_emails_from_role' );
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page
Scroll to Top