We would like to send bulk mail to the user list using wp_mail()
function.
Is it possible to send e-mail to users at a certain time (similar to newsletter plugins)? For example, dividing the list of 100 users into 10 groups of 10 people each. Is it possible to send mail to 10 groups with 5 minute intervals?
To give an example instead of theoretical:
We would like to automatically email users who have added "Technology" category to their favorites whenever they post a new post in this category.
How can we edit a function like this to do this?
add_action( 'transition_post_status', 'new_post_notice', 10, 3 );
function new_post_notice( $ID, $post ) {
if ( 'publish' === $new_status && 'publish' !== $old_status ) {
$to = //All users who have added "technology" categories to their favorites
$subject = 'A new post has been published!';
$message = 'E-mail body.';
wp_mail( $to, $subject, $message, $headers );
}
}
Can the sleep()
function be used to do this?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744880040a4598784.html
评论列表(0条)