From de8e82926ad97954ef486c00d8a373941a93a0ff Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 9 Sep 2024 14:54:32 +0200 Subject: [PATCH 1/2] sms messages rename --- app/init.php | 4 ++-- src/Appwrite/Platform/Workers/Messaging.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/init.php b/app/init.php index 892d9209a8..8db0343a8c 100644 --- a/app/init.php +++ b/app/init.php @@ -219,8 +219,8 @@ const API_KEY_DYNAMIC = 'dynamic'; // Usage metrics const METRIC_TEAMS = 'teams'; const METRIC_USERS = 'users'; -const METRIC_MESSAGES = 'messages'; -const METRIC_MESSAGES_COUNTRY_CODE = '{countryCode}.messages'; +const METRIC_AUTH_METHOD_PHONE = 'auth.methode.phone'; +const METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE = METRIC_AUTH_METHOD_PHONE . '.{countryCode}'; const METRIC_SESSIONS = 'sessions'; const METRIC_DATABASES = 'databases'; const METRIC_COLLECTIONS = 'collections'; diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 6f642fabb7..2f529374fc 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -452,10 +452,10 @@ class Messaging extends Action $countryCode = $adapter->getCountryCode($message['to'][0] ?? ''); if (!empty($countryCode)) { $queueForUsage - ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_MESSAGES_COUNTRY_CODE), 1); + ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE), 1); } $queueForUsage - ->addMetric(METRIC_MESSAGES, 1) + ->addMetric(METRIC_AUTH_METHOD_PHONE, 1) ->setProject($project) ->trigger(); } catch (\Throwable $th) { From 36486dd3f4e6e1d04d421719f28163ce0e0d382c Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 9 Sep 2024 15:05:11 +0200 Subject: [PATCH 2/2] sms messages rename --- app/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/init.php b/app/init.php index 8db0343a8c..f23eb80411 100644 --- a/app/init.php +++ b/app/init.php @@ -219,7 +219,7 @@ const API_KEY_DYNAMIC = 'dynamic'; // Usage metrics const METRIC_TEAMS = 'teams'; const METRIC_USERS = 'users'; -const METRIC_AUTH_METHOD_PHONE = 'auth.methode.phone'; +const METRIC_AUTH_METHOD_PHONE = 'auth.method.phone'; const METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE = METRIC_AUTH_METHOD_PHONE . '.{countryCode}'; const METRIC_SESSIONS = 'sessions'; const METRIC_DATABASES = 'databases';