I want my application will send a email after 10 minutes of sending another email.
In my application
A user completes registration with payment
Application sends the user a payment confirmation email
Now I want to
send another email 10 minutes After payment confirmation email with welcome tips
Below is the function where for user setup .
public function finishUserSetup($Sub){
if($Sub == 0){
$subscription = SubscriptionPlans::where('identifier', '=', "Monthly")->first();
$expiry = date('Y-m-d', strtotime('+' . $subscription->months . ' months'));
$sub_period = "monthly";
} else{
$subscription = SubscriptionPlans::where('identifier', '=', "Annually")->first();
$expiry = date('Y-m-d', strtotime('+' . $subscription->months . ' months'));
$sub_period = "annually";
}
$this->expiry_date = $expiry;
$this->user_type = "SUB";
$this->subscription_period = $sub_period;
$this->update();
$replaceArray = array(
'fullname' => $this->forename . " " . $this->surname,
'subscriptionName' => $subscription->name,
);
EmailTemplate::findAndSendTemplate("paymentconfirm", $this->email, $this->forename . " " . $this->surname, $replaceArray);
}
In the above function the last line of code is the one which sends a payment confirmation email to the user which is
EmailTemplate::findAndSendTemplate("paymentconfirm", $this->email, $this->forename . " " . $this->surname, $replaceArray);
I want to execute the following line of code 10 minutes after the above one
EmailTemplate::findAndSendTemplate("WelcomeTips", $this->email, $this->forename . " " . $this->surname, $replaceArray);
How to do that. that is running the last line of code 10 minutes after