+ Fix bug while sending mail
This commit is contained in:
parent
a18565658b
commit
d7981a2963
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue