wp_mail – send emails after 24 hours from users registration

You can’t schedule a future email from wp_mail * but you can use wp_schedule_single_event to run in 24 hours time, and write an action hook handler that calls wp_mail() to send your mail, e.g. something like

wp_schedule_single_event( time() + (60*60*24), 'send_new_user_next_day_email', args( $userId ) );

function send_new_user_next_day_email( $userId ) {
    // look up the user and call wp_mail()
}
add_action( 'send_new_user_next_day_email', 'send_new_user_next_day_email', 10, 1 );

Note that this runs on the WordPress cron system and so will trigger when you next get traffic on the site after the 24 hours are up. You can however set up system scheduler events to trigger cron events even when there’s no website traffic – see the wordpress.org cron docs.


* unless the mail server you’re sending through supports it, e.g. Office 365 does, but I’m not sure what mail headers etc. you’d need to set up to do that.

deneme bonusu veren sitelerbahis siteleripulibet girişdeneme bonusutürkçe altyazılı pornocanlı bahis casinocanlı bahis casino siteleriOnwin Güncel Girişholiganbetholiganbet girişholiganbet güncel girişnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewslandorbet