Coder Social home page Coder Social logo

cmdotcom / text-sdk-php Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 6.0 133 KB

PHP SDK to send messages with CM.com

Home Page: https://www.cm.com/communications-platform/

License: MIT License

PHP 100.00%
cm imessage line messaging push rcs sms text viber wechat whatsapp

text-sdk-php's People

Contributors

bgijzen avatar dennisenderink avatar enessene avatar ganboonhong avatar hexonthebeach avatar joepb avatar michaelvdnet avatar neodc avatar robinvoogt avatar tomodutch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

text-sdk-php's Issues

php8.1 support?

is there a php8.1 support planned yet?

I get those deprecate warnings:

PHP Deprecated: Return type of CMText\Message::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /apps/cm_messaging/src/CMText/Message.php on line 269
PHP Deprecated: Return type of CMText\MessageBody::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /apps/cm_messaging/src/CMText/MessageBody.php on line 90
PHP Deprecated: Return type of CMText\TextClientRequest::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /apps/cm_messaging/src/CMText/TextClientRequest.php on line 47

Thanks in advance.

Cannot send non-English text message.

$client = new TextClient("{{API_KEY}}"); $content = '你好'; $result = $client->SendMessage($content, 'Test', ['00852xxxxxxxx']);

Response:
TextClientResult {#592 ▼ -httpStatusCode: 200 -response: """ { "details": "Created 1 message(s)", "errorCode": 0, "messages": [ { "to": "00852xxxxxxxx", "status": "Accepted", "reference": null, "parts": 1, "messageDetails": null, "messageErrorCode": 0 } ] } """ +statusMessage: "Created 1 message(s)" +statusCode: 0 +details: array:1 [▼ 0 => {#594 ▼ +"to": "00852xxxxxxxx" +"status": "Accepted" +"reference": null +"parts": 1 +"messageDetails": null +"messageErrorCode": 0 } ] }

However, in Message log, it shows the message status is "Cancelled".

Missing Guzzle from deprecated sdk

Since this sdk replaces https://github.com/CMTelecom/messaging-php it would be helpful for people to have a more like for like replacement.

In my implementations of the previous sdk I've used the guzzle and its middleware for a different amount of extensions. Two of the most basic ones are logging (using out of the box Guzzle middleware) and testability (replacing the Guzzle handler with a Guzzle mock handler)

Is there any plans to update the curl implementation with Guzzle or are you willing to accept an PR that does just that?

Sender Name Japanese Problem.

I'd like to send the sms with japanese sender name.
But It's marked ??.

What is the solution in this case?

Thanks.

Webhook

Hey guys i'm struggling to design a webhook using this sdk for whatsapp. may you kindly assist.

Can MESSAGEPARTS_MAXIMUM be set to 10?

You now have a __set method in the Message class. But now the phpstan
wil give an error as follows. Either please create a normal set method or set the constant MESSAGEPARTS_MAXIMUM to 10 would be very much appreciated.

Access to private property CMText\Message::$maximumNumberOfMessageParts.

SendMessage

"statusMessage": "Created 1 message(s)",
"statusCode": 0,
"details": [
{
"to": "86132xxxxxxxx",
"status": "Accepted",
"reference": "4950fb39-bcfd-4ce1-b731-612ab9840e20",
"parts": 1,
"messageDetails": null,
"messageErrorCode": 0
}
]

But I didn't receive the text message

Is there an SDK For making Whatsapp webhooks

Hi guys i need assistance. I have been trying to get to you but to no avail, is there an SDK for creating Whatsapp webhooks. If not, how do I go about doing that in PHP. I am behind time, i hope you assist me. Thank you in advance.

sender name is longer as allowed

Sender name is larger then the allowed maximum length (16 digits for a phonenumber or 11 alphanumerical characters [a-zA-Z]). It is still tried to send the SMS.

The SDK-Client returns "Accepted" as result, although the status is "Cancelled" in Messaging Log (cm.com).

Would be great to use fallback if sender name is to long or deny sending sms and returns correct status.

Laravel support

Can you make the package Laravel compatible or at least create a wrapper library for Laravel

Allow plain texts messages

Now we're forced to use type AUTO because now the code is as follows:

**
 * Class MessageBody
 *
 * @package CMText
 */
class MessageBody implements JsonSerializable
{
    ...
    /**
     * @var string
     */
    private $type = MessageBodyTypes::AUTO;
    ...

There is no way to override this. Can you please create a setter so we can set the body type?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.