회원들에게 댓글 이메일 알림

안녕하세요?

댓글 알림 관련 글이 많아 읽고 적용을 해보았는데 댓글 알림이 가입된 회원 이메일로 전송되지 않는듯 합니다.

적용한 코드는 아래와 같습니다.

add_action('kboard_comments_insert', 'my_kboard_comments_insert', 10, 2);
function my_kboard_comments_insert($comment_uid, $content_uid){
$comment = new KBComment();
$comment->initWithUID($insert_id);

if($comment->parent_uid){
$parent = new KBComment();
$parent->initWithUID($comment->parent_uid);

if($parent->user_uid){
$user = new WP_User($parent->user_uid);

if($user->user_email && $user->ID != get_current_user_id()){

$title = '등록하신 댓글에 답변이 등록되었습니다.'; // 알림 이메일 제목
$content = '등록하신 댓글에 대해 답변이 등록 되었습니다.'; // 알림 이메일 본문 내용
wp_mail($user->user_email, $title, $content);
}
}
}
}

혹시 잘못된 부분이 있으면 조언 부탁드립니다 ^^

http://twentyone21.godohosting.com/wp/q-a/

 

감사합니다.

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기