Browse: Home / Hooks /

ld_group_email_users_args

apply_filters( 'ld_group_email_users_args',  array $mail_args )

Filters group email user arguments.


Description #


Parameters #

$mail_args

(array) Group mail arguments.


Source #

File: includes/ld-groups.php


Examples #

Note: Extended code example below not guaranteed, you may need to consult with a developer

 <?php
/**
 * Example usage for ld_group_email_users_args filter.
 */
add_filters(
	'ld_group_email_users_args',
	function ( $mail_args = array() ) {

		// By default the Group email is sent to the group users in batches of 100 and the user
		// email addresses are added as Bcc. This means the 'To' field is empty. On some sites
		// this causes the wp_mail() call to fail.
		if ( ( ! isset( $mail_args['to'] ) ) || ( empty( $mail_args['to'] ) ) ) {
			$mail_args['to'] = 'some_email.domain.com'; // This should be changed to some specific to address.
		}

		// Always return $mail_args;
		return $mail_args;
	}
);