+ Fix bug while sending mail

This commit is contained in:
Djery-Tom 2020-12-06 14:26:12 +01:00
parent a18565658b
commit d7981a2963
1 changed files with 10 additions and 2 deletions

View File

@ -59,7 +59,11 @@ trait Helper
$body->user_code = $user_code;
$body->message = $message;
$body->data = $data;
try {
$body->date = $date->format('Y-m-d H:i:s');
} catch (\Exception $e) {
$body->date = $date;
}
$promise = $client->requestAsync('POST', '/onesignal/pushToUser', ['json' => $body, 'headers' => $headers])->then();
// function (ResponseInterface $res) {
// echo $res->getStatusCode() . "\n";
@ -85,7 +89,11 @@ trait Helper
$body->agent_code = $agent_code;
$body->message = $message;
$body->data = $data;
try {
$body->date = $date->format('Y-m-d H:i:s');
} catch (\Exception $e) {
$body->date = $date;
}
$promise = $client->requestAsync('POST', '/onesignal/pushToAgent', ['json' => $body, 'headers' => $headers])->then();
$promise->wait();
}