
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
- I have an error oauth with Microsoft
invalid_request: The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect URI registered for...
- how many Teams can be created?
I am creating an app where I will let users create groups. This could mean there will be many groups created by user, to isolate those groups properly I am thin...
- React native app login via Safari
Hi! I deployed for debug my React Native app in web, chrome everythink works well but in safari on mac and ios I cant login. I found this one error in safari co...
