admin管理员组

文章数量:1296847

I'm a bit lost on this one and would appreciate some direction. I have created a plugin that sends a message to a user after they successfully sign up. However, I would like this message to be sent 24 hours after the event is triggered (their account verification).

Thanks!

I'm a bit lost on this one and would appreciate some direction. I have created a plugin that sends a message to a user after they successfully sign up. However, I would like this message to be sent 24 hours after the event is triggered (their account verification).

Thanks!

Share Improve this question asked Apr 1, 2021 at 7:13 DazzaDazza 234 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

In below function take the registration date of the user and add 24 hours to the registration date. If current time matches the $notify time then send message.

$notify = date("Y-m-d H:i:s",strtotime("+24 hours",strtotime($registration_date)));
if(date("Y-m-d H:i:s")==$notify){
    //send message code
}

本文标签: Run PHP 24hrs After Event Trigger