I want to execute these functions when user click on button but I want to execute $model->user->email ? $model->sendUserMail(): ""; that function asynchronously in background while other function will execute as click occur
Here is my code
if (isset($_POST['create_send'])) {
if ($model->save()) {
$model->order_id = strtotime(date("Y-m-d H:i:s")) + '' + $model->id;
// send mail
$model->sendMail();
//send sms
$messages = $model->sendSMSMessage($model);
// create booking history
$model->createBookingHistory($model , $messages);
$model->user->email ? $model->sendUserMail(): "";
if($model->booking_stage != 'inprogress'){
$this->sendPushToSeller($model);
}
$model->update();
$this->redirect(array('index', 'id' => $model->id));
}
}