diff --git a/src/Appwrite/Event/Build.php b/src/Appwrite/Event/Build.php index 79437c3e58..38f423829e 100644 --- a/src/Appwrite/Event/Build.php +++ b/src/Appwrite/Event/Build.php @@ -2,6 +2,7 @@ namespace Appwrite\Event; +use Utopia\Config\Config; use Utopia\Database\Document; use Utopia\Queue\Publisher; @@ -110,13 +111,18 @@ class Build extends Event */ protected function preparePayload(): array { + $platform = $this->platform; + if (empty($platform)) { + $platform = Config::getParam('platform', []); + } + return [ 'project' => $this->project, 'resource' => $this->resource, 'deployment' => $this->deployment, 'type' => $this->type, 'template' => $this->template, - 'platform' => $this->platform + 'platform' => $platform, ]; } diff --git a/src/Appwrite/Event/Func.php b/src/Appwrite/Event/Func.php index 380a28f1db..c9622a9ce0 100644 --- a/src/Appwrite/Event/Func.php +++ b/src/Appwrite/Event/Func.php @@ -2,6 +2,7 @@ namespace Appwrite\Event; +use Utopia\Config\Config; use Utopia\Database\Document; use Utopia\Queue\Publisher; @@ -202,6 +203,11 @@ class Func extends Event { $events = $this->getEvent() ? Event::generateEvents($this->getEvent(), $this->getParams()) : null; + $platform = $this->platform; + if (empty($platform)) { + $platform = Config::getParam('platform', []); + } + return [ 'project' => $this->project, 'user' => $this->user, @@ -217,7 +223,7 @@ class Func extends Event 'path' => $this->path, 'headers' => $this->headers, 'method' => $this->method, - 'platform' => $this->platform + 'platform' => $platform, ]; } } diff --git a/src/Appwrite/Event/Mail.php b/src/Appwrite/Event/Mail.php index c801d30493..ed96f6f93a 100644 --- a/src/Appwrite/Event/Mail.php +++ b/src/Appwrite/Event/Mail.php @@ -2,6 +2,7 @@ namespace Appwrite\Event; +use Utopia\Config\Config; use Utopia\Queue\Publisher; class Mail extends Event @@ -516,6 +517,11 @@ class Mail extends Event */ protected function preparePayload(): array { + $platform = $this->platform; + if (empty($platform)) { + $platform = Config::getParam('platform', []); + } + return [ 'project' => $this->project, 'recipient' => $this->recipient, @@ -528,7 +534,8 @@ class Mail extends Event 'variables' => $this->variables, 'attachment' => $this->attachment, 'customMailOptions' => $this->customMailOptions, - 'events' => Event::generateEvents($this->getEvent(), $this->getParams()) + 'events' => Event::generateEvents($this->getEvent(), $this->getParams()), + 'platform' => $platform, ]; } } diff --git a/src/Appwrite/Event/Migration.php b/src/Appwrite/Event/Migration.php index ca54310ce6..a224d4f4c3 100644 --- a/src/Appwrite/Event/Migration.php +++ b/src/Appwrite/Event/Migration.php @@ -2,6 +2,7 @@ namespace Appwrite\Event; +use Utopia\Config\Config; use Utopia\Database\Document; use Utopia\Queue\Publisher; @@ -73,11 +74,16 @@ class Migration extends Event */ protected function preparePayload(): array { + $platform = $this->platform; + if (empty($platform)) { + $platform = Config::getParam('platform', []); + } + return [ 'project' => $this->project, 'user' => $this->user, 'migration' => $this->migration, - 'platform' => $this->platform, + 'platform' => $platform, ]; } }