
This is an issue I have been facing with fixing this github issue- https://github.com/appwrite/appwrite/issues/6386 . My doubt is I am not able to find CM adapter information. Could anyone please guide me regarding this. I also wanted to know how can I test this after creating the adapter.

the requirements for picking up this issue was:
Experience with CM.

Have you read through their docs?

I've had some experience with PHP and was planning to learn to integrate CM along the way via solving this issue.
<?php
namespace Utopia\Messaging\Adapters\SMS;
use Utopia\Messaging\Adapters\SMS as SMSAdapter;
use Utopia\Messaging\Messages\SMS;
class CM extends SMSAdapter
{
/**
* @param string $apiKey CM API Key
*/
public function __construct(
private string $apiKey
) {
}
public function getName(): string
{
return 'CM';
}
public function getMaxMessagesPerRequest(): int
{
return 1;
}
/**
* {@inheritdoc}
*
* @throws \Exception
*/
protected function process(SMS $message): string
{
return $this->request(
method: 'POST',
url: 'https://api.cmtelecom.com/v1.0/message',
headers: [
'Content-Type: application/json',
'Authorization: Bearer ' . $this->apiKey,
],
body: json_encode([
'from' => $message->getFrom(),
'to' => $message->getTo()[0],
'body' => $message->getContent(),
]),
);
}
}
This is what I have come up with

Make sure to test it and add any reference material to the PR (or as comments in the code)


Could you please review this once

Linting failed. Please also add screenshots of successful tests

I haven't tested it actually. How can I pass the Linting tests?

We have the linting information in our contributing guide here

Okay thanks, I’ll look into it

Let us know if we can close this thread for now. You can always text again, if you have more doubts 🙂

Sure

[CLOSED] Implement support for CM in the Utopia PHP messaging library
Recommended threads
- Queries Length Error.
Hi All, I am having a issues across my app with how i am getting data, and just wanted to check if this was an issues with the new changes on appwrite over the...
- My projects archived. Did not see the up...
Kindly restore project for me: 67680a26001bdf36beb8 You can delete: 678c96ba00305f78bb13 675d05040004853fb43f
- My projects archived. Did not see the up...
Kindly restore these two projects for me 66d6f4270037aafe3c39 and 663fdf520017d2d0f4e8 You can delete 66887997000e2c5b7e49
