Automattic\WooCommerce\Internal\Admin\Notes

MerchantEmailNotifications::get_notification_recipients()public staticWC 1.0

Get users by role to notify.

Method of the class: MerchantEmailNotifications{}

No Hooks.

Return

Array. Users to notify

Usage

$result = MerchantEmailNotifications::get_notification_recipients( $note );
$note(object) (required)
The note to send.

MerchantEmailNotifications::get_notification_recipients() code WC 8.7.0

public static function get_notification_recipients( $note ) {
	$content_data = $note->get_content_data();
	$role         = 'administrator';
	if ( isset( $content_data->role ) ) {
		$role = $content_data->role;
	}
	$args = array( 'role' => $role );
	return get_users( $args );
}