mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch 'feat-mailgun-provider' into feat-topics-controller
This commit is contained in:
@@ -1238,7 +1238,7 @@ App::post('/v1/account/sessions/phone')
|
||||
->inject('locale')
|
||||
->action(function (string $userId, string $phone, string $from, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $events, Messaging $messaging, Locale $locale) {
|
||||
$provider = Authorization::skip(fn () => $dbForProject->findOne('providers', [
|
||||
Query::equal('default', [true, false]),
|
||||
Query::equal('default', [true, false]),
|
||||
Query::equal('type', ['sms'])
|
||||
]));
|
||||
if ($provider === false || $provider->isEmpty()) {
|
||||
@@ -1341,7 +1341,7 @@ App::post('/v1/account/sessions/phone')
|
||||
->setMessage($messageDoc)
|
||||
->setProject($project)
|
||||
->trigger();
|
||||
|
||||
|
||||
$events->setPayload(
|
||||
$response->output(
|
||||
$token->setAttribute('secret', $secret),
|
||||
@@ -2898,7 +2898,7 @@ App::post('/v1/account/verification/phone')
|
||||
->inject('locale')
|
||||
->action(function (string $from, Request $request, Response $response, Document $user, Database $dbForProject, Event $events, Messaging $messaging, Document $project, Locale $locale) {
|
||||
$provider = Authorization::skip(fn () => $dbForProject->findOne('providers', [
|
||||
Query::equal('default', [true, false]),
|
||||
Query::equal('default', [true, false]),
|
||||
Query::equal('type', ['sms'])
|
||||
]));
|
||||
if ($provider === false || $provider->isEmpty()) {
|
||||
|
||||
@@ -627,7 +627,7 @@ App::post('/v1/teams/:teamId/memberships')
|
||||
;
|
||||
} elseif (!empty($phone)) {
|
||||
$provider = Authorization::skip(fn () => $dbForProject->findOne('providers', [
|
||||
Query::equal('default', [true, false]),
|
||||
Query::equal('default', [true, false]),
|
||||
Query::equal('type', ['sms'])
|
||||
]));
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class MessagingV1 extends Worker
|
||||
$message = new Document($this->args['message']);
|
||||
|
||||
$providerId = $message->getAttribute('providerId');
|
||||
$providerRecord =$dbForProject->getDocument('providers', $providerId);
|
||||
$providerRecord = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
$provider = match ($providerRecord->getAttribute('type')) {//stubbbbbbed.
|
||||
'sms' => $this->sms($providerRecord),
|
||||
@@ -110,7 +110,7 @@ class MessagingV1 extends Worker
|
||||
'email' => $this->buildEmailMessage($message->getArrayCopy()),
|
||||
default => null
|
||||
};
|
||||
|
||||
|
||||
|
||||
$provider->send($message);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class Messaging extends Event
|
||||
{
|
||||
parent::__construct(Event::MESSAGING_QUEUE_NAME, Event::MESSAGING_CLASS_NAME);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -743,7 +743,7 @@ class AccountCustomClientTest extends Scope
|
||||
public function testCreatePhone(): array
|
||||
{
|
||||
$number = '+123456789';
|
||||
$response = $this->client->call(Client::METHOD_POST, '/messaging/providers/general' , \array_merge([
|
||||
$response = $this->client->call(Client::METHOD_POST, '/messaging/providers/general', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||
|
||||
Reference in New Issue
Block a user