Fix user notification v3
This commit is contained in:
parent
dc5b4283da
commit
9c8c85bcc7
|
@ -9,6 +9,7 @@ use GuzzleHttp\Client;
|
|||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use stdClass;
|
||||
use Throwable;
|
||||
|
||||
class NotifyUser
|
||||
|
@ -43,7 +44,7 @@ class NotifyUser
|
|||
$headers = [
|
||||
'Authorization' => config('services.notification_service.key'),
|
||||
];
|
||||
$body = new \stdClass();
|
||||
$body = new stdClass();
|
||||
$body->title = $event->mailTitle;
|
||||
$body->message = $event->mailMessage;
|
||||
$body->email = $user->email;
|
||||
|
@ -51,13 +52,15 @@ class NotifyUser
|
|||
$client->request('POST', '/send-mail', ['json' => $body, 'headers' => $headers]);
|
||||
|
||||
if (isset($event->notification)) {
|
||||
$body = new \stdClass();
|
||||
$body = new stdClass();
|
||||
$body->user_code = $user->user_code;
|
||||
$body->message = $event->notification;
|
||||
$data = new \stdClass();
|
||||
$data = new stdClass();
|
||||
$data->screen = "notificationview";
|
||||
$data->data = new \stdClass();
|
||||
$data->data = new stdClass();
|
||||
$data->data->subscription_id = $data->data->id = $subscription->id;
|
||||
$body->data = $data;
|
||||
|
||||
try {
|
||||
$body->date = $this->getCurrentTimeByCountryCode($user->network->country->code_country);
|
||||
} catch (Throwable $t) {
|
||||
|
|
Loading…
Reference in New Issue