카테고리 변경시 이메일과 알림톡 발송

안녕하세요.

 

수고 많으십니다. 회원관리 프로그램 구매하여 잘 쓰고 있습니다.

 

지금까지 작성된 글의 카테고리가 변경될 경우 이메일로 알림을 보내고 있었으나

카카오톡 알림톡도 적용하고 싶어 코드를 수정하고 있으나 실력이 부족해 어려움을 겪고 있습니다.

 

토스트와 워드프레스에서 설정은 마친 상태입니다.

스레드 뒤져가며 아래와 같이 코드를 짯지만 동작되지 않는 상황인데 조금 도와 주시면 감사합니다.

 

add_action('kboard_pre_document_update', 'kboard_pre_document_update_210903', 10, 4);
function kboard_pre_document_update_210903($content_uid, $board_id, $content, $user_id){
	global $wpdb;
	$user_email = get_userdata($content->row->member_uid)->user_email;
	$pre_category2 = $wpdb->get_var("SELECT `category2` FROM {$wpdb->prefix}kboard_board_content WHERE `uid` = '{$content_uid}' ");
	$category1 = $content->row->category1;
	$category2 = $content->row->category2;
	$document = new KBContent();
	$document->initWithUID($content_uid);
	$phone_number = get_user_meta($user_id, 'billing_phone', true);
    $template = 'sent_done';
	
		

	if($content->category2 == 'Purchasing Service Register' && $board_id == '4'){


		if($phone_number){
            cosmosfarm_members_alimtalk_send($phone_number, $template);
        }


		if(!class_exists('KBMail')){
			include_once KBOARD_DIR_PATH . '/class/KBMail.class.php';
		}
		$url = new KBUrl();
		$mail = new KBMail();
		$mail->to = get_option('admin_email');
		$mail->title = "구매대행 신청서 확인 [PS10".$content->uid."]";
		$mail->content = "<b>회원ID: </b>".$content->member_display."<br>
		<b>신청번호: </b>PS10".$content->uid."<br><b>주문상태: </b>신청서 확인 중<br><hr><br>";
		$mail->url = $url->getDocumentRedirect($document->uid);
		$mail->url_name = '신청서로 이동하기';
		$mail->send();
		}
}

 

 

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