음, 여기에서는 일반적으로 플러그인을 제안하지 않습니다. 이 약간 제안을 위해 Software Recommendations 위치를 위해 가십시오 워드 프레스 꼬리표가있다. 추천은이 워드 프레스 태그입니다.
이제 우리는 일정 시간이 지난 후에 메일을 어떻게 처리 할 수 있는지 코딩 개념의 솔루션으로 왔습니다. 여기에 내가 방금 인수를 사용하여 the_dramatist_handle_scheduled_mail()
를 호출하여 기본 이벤트 후 이제 이메일 -
add_action('the_dramatist_send_email_after_three_days', 'the_dramatist_send_email_after_three_days_function', 10, 2);
function the_dramatist_send_email_after_three_days_function($arg_1, $args_2) {
$to = '[email protected]';
$user = get_user_by('email', $to);
if (1 === get_user_meta($user->ID, 'after_three_days_email', true)) {
return false;
}
$subject = 'The subject';
$body = 'The email body content';
$headers = array('Content-Type: text/html; charset=UTF-8');
$mail_sent = wp_mail($to, $subject, $body, $headers);
// After sending the email to every person I prefer to put a record.
if ($mail_sent) {
update_user_meta($user->ID, 'after_three_days_email', 1);
return true;
}
}
을 보내 당신이 다음과 같은 기능을 추가하려면이 the_dramatist_send_email_after_three_days
후크에 방법 - 지금
function the_dramatist_handle_scheduled_mail($arg_1 = '', $arg_2 = []) {
wp_schedule_single_event(
// Here time() is the time when this is firing and 259200s = 72h = 3d
time() + 259200,
// Declaring a hook at this point. You can hook any function to this point which you want to fire after three days of any base event.
'the_dramatist_send_email_after_three_days',
// You can add number of arguments to the hook also.
[ $arg_1, $arg_2 ]
);
return true;
}
을 제안 할 수 있습니다 . 이 방법을 사용하면 wp_schedule_single_event()
기능으로 WordPress에서 예약 된 이벤트를 처리 할 수 있습니다.
위의 답변을 참조하십시오.