
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
- Web SDK chunk upload to Storage without ...
As discussed in this older thread (https://discord.com/channels/564160730845151244/1216821517749321808), the Read permission for Any needs to be enabled in orde...
- Issue while signing up.
Hey, I’m running into an issue right after the setup. I followed the setup instructions and ran `docker compose up -d`, and while the local server seems to be r...
- Cannot resolve server
Greetings! Is this a known issue at this time? Cloudflare reports likewise. Please advise, thank you!
