From c32545fb4956f8efb37ea1ae076b5b5094cc0ea0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 Feb 2024 04:13:35 +1300 Subject: [PATCH] Fix push message creation warnings --- src/Appwrite/Platform/Workers/Messaging.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 6f1e2314c2..5bc1560166 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -463,7 +463,7 @@ class Messaging extends Action $to = $message['to']; $subject = $data['subject']; $content = $data['content']; - $html = $data['html']; + $html = $data['html'] ?? false; return new Email($to, $subject, $content, $fromName, $fromEmail, $replyToName, $replyToEmail, $cc, $bcc, null, $html); } @@ -482,13 +482,13 @@ class Messaging extends Action $to = $message['to']; $title = $message['data']['title']; $body = $message['data']['body']; - $data = $message['data']['data']; - $action = $message['data']['action']; - $sound = $message['data']['sound']; - $icon = $message['data']['icon']; - $color = $message['data']['color']; - $tag = $message['data']['tag']; - $badge = $message['data']['badge']; + $data = $message['data']['data'] ?? null; + $action = $message['data']['action'] ?? null; + $sound = $message['data']['sound'] ?? null; + $icon = $message['data']['icon'] ?? null; + $color = $message['data']['color'] ?? null; + $tag = $message['data']['tag'] ?? null; + $badge = $message['data']['badge'] ?? null; return new Push($to, $title, $body, $data, $action, $sound, $icon, $color, $tag, $badge); }