+ 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->user_code = $user_code;
|
||||||
$body->message = $message;
|
$body->message = $message;
|
||||||
$body->data = $data;
|
$body->data = $data;
|
||||||
|
try {
|
||||||
$body->date = $date->format('Y-m-d H:i:s');
|
$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();
|
$promise = $client->requestAsync('POST', '/onesignal/pushToUser', ['json' => $body, 'headers' => $headers])->then();
|
||||||
// function (ResponseInterface $res) {
|
// function (ResponseInterface $res) {
|
||||||
// echo $res->getStatusCode() . "\n";
|
// echo $res->getStatusCode() . "\n";
|
||||||
|
@ -85,7 +89,11 @@ trait Helper
|
||||||
$body->agent_code = $agent_code;
|
$body->agent_code = $agent_code;
|
||||||
$body->message = $message;
|
$body->message = $message;
|
||||||
$body->data = $data;
|
$body->data = $data;
|
||||||
|
try {
|
||||||
$body->date = $date->format('Y-m-d H:i:s');
|
$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 = $client->requestAsync('POST', '/onesignal/pushToAgent', ['json' => $body, 'headers' => $headers])->then();
|
||||||
$promise->wait();
|
$promise->wait();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue