以下是我到目前为止的情况。。
class emailer {
function notifyHeart($post_ID) {
$interests = get_user_meta( get_current_user_id(), \'interests\', TRUE );
$to = the_author_meta( \'user_email\', get_current_user_id() );
if(has_tag($interests[0])) {
$email = $to;
mail($email, "An article about Heart",
\'A new post has been published about heart.\');
return $post_ID;
}
}
}
add_action(\'publish_post\', array(\'emailer\', \'notifyHeart\'));
我现在需要做的是,在实际发送电子邮件之前,我需要一些东西来检查用户是否对美元感兴趣,如果有兴趣,请向他们发送电子邮件。有什么帮助吗?