From f62979cfa8e4fc05e221a5e72977b7e48848ce04 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 14 May 2025 15:41:21 +0530 Subject: [PATCH] feat: inforu adapter (#9620) * chore: update utopia messaging library * chore: init inforu adapter * chore: use dev message * chore: update composer * chore: fix ordering * chore: use user for senderId --- composer.json | 2 +- composer.lock | 14 +++++++------- src/Appwrite/Platform/Workers/Messaging.php | 9 +++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 9b2cf7a1ab..8b8bb811af 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "utopia-php/image": "0.8.*", "utopia-php/locale": "0.4.*", "utopia-php/logger": "0.6.*", - "utopia-php/messaging": "0.16.*", + "utopia-php/messaging": "0.17.*", "utopia-php/migration": "0.9.*", "utopia-php/orchestration": "0.9.*", "utopia-php/platform": "0.7.*", diff --git a/composer.lock b/composer.lock index e6bcd919e2..5e86bfafd2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1eeb5a0f3560aefd8f71bd0955e30360", + "content-hash": "2c14e20244a06f508dd67cda717aefeb", "packages": [ { "name": "adhocore/jwt", @@ -3902,16 +3902,16 @@ }, { "name": "utopia-php/messaging", - "version": "0.16.0", + "version": "0.17.0", "source": { "type": "git", "url": "https://github.com/utopia-php/messaging.git", - "reference": "5f3083697102b1821d6624938186761b1e09c54e" + "reference": "c51915d0e030db3a3add37f1561751d18b2d9a85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/messaging/zipball/5f3083697102b1821d6624938186761b1e09c54e", - "reference": "5f3083697102b1821d6624938186761b1e09c54e", + "url": "https://api.github.com/repos/utopia-php/messaging/zipball/c51915d0e030db3a3add37f1561751d18b2d9a85", + "reference": "c51915d0e030db3a3add37f1561751d18b2d9a85", "shasum": "" }, "require": { @@ -3947,9 +3947,9 @@ ], "support": { "issues": "https://github.com/utopia-php/messaging/issues", - "source": "https://github.com/utopia-php/messaging/tree/0.16.0" + "source": "https://github.com/utopia-php/messaging/tree/0.17.0" }, - "time": "2025-02-18T08:27:00+00:00" + "time": "2025-05-12T16:14:08+00:00" }, { "name": "utopia-php/migration", diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index cf2b8bfc84..c9eca2a1e0 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -24,6 +24,7 @@ use Utopia\Messaging\Adapter\Push\FCM; use Utopia\Messaging\Adapter\SMS as SMSAdapter; use Utopia\Messaging\Adapter\SMS\Fast2SMS; use Utopia\Messaging\Adapter\SMS\GEOSMS; +use Utopia\Messaging\Adapter\SMS\Inforu; use Utopia\Messaging\Adapter\SMS\Mock; use Utopia\Messaging\Adapter\SMS\Msg91; use Utopia\Messaging\Adapter\SMS\Telesign; @@ -455,6 +456,10 @@ class Messaging extends Action $credentials['messageId'] ?? '', $credentials['useDLT'] ?? true ), + 'inforu' => new Inforu( + $credentials['senderId'] ?? '', + $credentials['apiKey'] ?? '', + ), default => null }; } @@ -780,6 +785,10 @@ class Messaging extends Action 'messageId' => $dsn->getParam('messageId'), 'useDLT' => $dsn->getParam('useDLT'), ], + 'inforu' => [ + 'senderId' => $user, + 'apiKey' => $password, + ], default => null }, 'options' => match ($host) {