Skip to content

Commit

Permalink
Added Channels for Telegram and Apple Business
Browse files Browse the repository at this point in the history
  • Loading branch information
hexonthebeach committed Jun 22, 2022
1 parent 661f5da commit 2eea62e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ A software development kit to provide ways to interact with CM.com's Text servic
### Instantiate the client
Using your unique `ApiKey` (or product token) which authorizes you on the CM platform. Always keep this key secret!

The product token can be found in the [Channels](https://www.cm.com/app/channels) application on the platform, under the `Gateway` section.

```php
$client = new \CMText\TextClient('your-api-key');
```
Expand Down
13 changes: 13 additions & 0 deletions src/CMText/Channels.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,16 @@ class Channels
/**
* Send Apple Business Chat messages.
* @note CM needs to configure this with you.
* @deprecated instead use APPLEMESSAGESFORBUSINESS
*/
const IMESSAGE = 'iMessage';

/**
* Send Apple Messages For Business messages.
* @note CM needs to configure this with you.
*/
const APPLEMESSAGESFORBUSINESS = 'Apple Messages for Business';

/**
* Send Line messages.
* @note CM needs to configure this with you.
Expand Down Expand Up @@ -87,4 +94,10 @@ class Channels
* @note CM needs to configure this with you.
*/
const INSTAGRAM = 'Instagram';

/**
* Send Telegram messages.
* @note CM needs to configure this with you.
*/
const TELEGRAM = 'Telegram Messenger';
}
9 changes: 9 additions & 0 deletions src/CMText/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class Message implements JsonSerializable
/**
* @var string Sender name
* @note Twitter requires the snowflake-id of the account you want to use as sender
* @note MobilePush: use the app key of the account you want to use as sender.
* @note Facebook Messenger: use the Facebook Page ID of the account you want to use as sender.
* @note Google Business Messages: use the Google Business Messages agent ID of the account you want to use as sender (without dashes).
* @note Instagram: use the Instagram Account ID of the account you want to use as sender.
* @note Telegram: use the Telegram Bot ID of the account you want to use as sender.
*/
private $from;

Expand All @@ -42,6 +47,10 @@ class Message implements JsonSerializable
/**
* @var array List of Recipients
* @note Twitter requires the snowflake-id
* @note Facebook Messenger: use the Facebook Page Scoped User ID (PSID).
* @note Google Business Messages: use the Google Business Messages conversation ID (without dashes).
* @note Instagram: use the Instagram Scoped User ID (IGSID).
* @note Telegram: use the Telegram Chat ID.
*/
private $to = [];

Expand Down

0 comments on commit 2eea62e

Please sign in to comment.