Browse Source

安装cm.com提供的插件。composer require cmdotcom/text-sdk-php

lizhen_gitee 1 year ago
parent
commit
4224e34033
100 changed files with 4518 additions and 2 deletions
  1. 2 1
      composer.json
  2. 66 1
      composer.lock
  3. 4 0
      vendor/cmdotcom/text-sdk-php/.gitignore
  4. 23 0
      vendor/cmdotcom/text-sdk-php/.travis.yml
  5. 21 0
      vendor/cmdotcom/text-sdk-php/LICENSE
  6. 252 0
      vendor/cmdotcom/text-sdk-php/README.md
  7. 29 0
      vendor/cmdotcom/text-sdk-php/composer.json
  8. 19 0
      vendor/cmdotcom/text-sdk-php/example/example.php
  9. 103 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Channels.php
  10. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactAddressException.php
  11. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactEmailException.php
  12. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactException.php
  13. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactPhonenumberException.php
  14. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactUrlException.php
  15. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ConversationLimitException.php
  16. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/MessagesLimitException.php
  17. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/RecipientLimitException.php
  18. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/SuggestionsLimitException.php
  19. 9 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/WhatsappTemplateComponentParameterTypeException.php
  20. 41 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Gateways.php
  21. 47 0
      vendor/cmdotcom/text-sdk-php/src/CMText/ITextClient.php
  22. 316 0
      vendor/cmdotcom/text-sdk-php/src/CMText/Message.php
  23. 98 0
      vendor/cmdotcom/text-sdk-php/src/CMText/MessageBody.php
  24. 30 0
      vendor/cmdotcom/text-sdk-php/src/CMText/MessageBodyTypes.php
  25. 186 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/Contact.php
  26. 112 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactAddress.php
  27. 13 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactAddressTypes.php
  28. 33 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactBirthday.php
  29. 62 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactEmail.php
  30. 13 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactEmailTypes.php
  31. 90 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactName.php
  32. 56 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactOrganization.php
  33. 61 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactPhonenumber.php
  34. 16 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactPhonenumberTypes.php
  35. 51 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactUrl.php
  36. 52 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/LineItem.php
  37. 40 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ViewLocationBase.php
  38. 48 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ViewLocationDynamic.php
  39. 58 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ViewLocationStatic.php
  40. 52 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/CardMessage.php
  41. 22 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/CarouselCardWidth.php
  42. 70 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/CarouselMessage.php
  43. 47 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/ContactsMessage.php
  44. 11 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/IRichMessage.php
  45. 38 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/LocationPushMessage.php
  46. 55 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/MediaContent.php
  47. 41 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/MediaMessage.php
  48. 35 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/PaymentMessage.php
  49. 27 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/TemplateMessage.php
  50. 44 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/TextMessage.php
  51. 8 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/IWhatsAppInteractiveAction.php
  52. 15 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveBody.php
  53. 24 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveButtonAction.php
  54. 13 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveButtonBase.php
  55. 8 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveButtonTypes.php
  56. 74 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveContent.php
  57. 11 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveContentTypes.php
  58. 18 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveFooter.php
  59. 34 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveHeader.php
  60. 11 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveHeaderTypes.php
  61. 30 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveListAction.php
  62. 29 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveMessage.php
  63. 21 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveReplyButton.php
  64. 32 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveSection.php
  65. 29 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveSectionRow.php
  66. 117 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Payments/ApplePayConfiguration.php
  67. 35 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Payments/PaymentConfigurationBase.php
  68. 79 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/RichContent.php
  69. 65 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/CalendarOptions.php
  70. 48 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/CalendarSuggestion.php
  71. 35 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/DialOptions.php
  72. 48 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/DialSuggestion.php
  73. 12 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/ISuggestion.php
  74. 47 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/OpenUrlSuggestion.php
  75. 43 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/ReplySuggestion.php
  76. 25 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/SuggestionBase.php
  77. 50 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/ViewLocationSuggestion.php
  78. 13 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/ITemplateContent.php
  79. 32 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/TemplateContentBase.php
  80. 88 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentBase.php
  81. 34 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentBody.php
  82. 45 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentButton.php
  83. 31 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentButtonQuickReply.php
  84. 31 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentButtonUrl.php
  85. 34 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentFooter.php
  86. 35 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentHeader.php
  87. 38 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterBase.php
  88. 42 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterCurrency.php
  89. 40 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterDatetime.php
  90. 32 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterDocument.php
  91. 32 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterImage.php
  92. 29 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterPayload.php
  93. 30 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterText.php
  94. 33 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterVideo.php
  95. 41 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/Language.php
  96. 52 0
      vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/WhatsappTemplate.php
  97. 137 0
      vendor/cmdotcom/text-sdk-php/src/CMText/TextClient.php
  98. 61 0
      vendor/cmdotcom/text-sdk-php/src/CMText/TextClientRequest.php
  99. 74 0
      vendor/cmdotcom/text-sdk-php/src/CMText/TextClientResult.php
  100. 99 0
      vendor/cmdotcom/text-sdk-php/src/CMText/TextClientStatusCodes.php

+ 2 - 1
composer.json

@@ -31,7 +31,8 @@
         "ext-pdo": "*",
         "ext-bcmath": "*",
         "txthinking/mailer": "^2.0",
-        "aws/aws-sdk-php": "^3.295"
+        "aws/aws-sdk-php": "^3.295",
+        "cmdotcom/text-sdk-php": "^2.2"
     },
     "config": {
         "preferred-install": "dist"

+ 66 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "63817e5296815cc430f881c477d216cc",
+    "content-hash": "692de98800f520839f876202e732c09b",
     "packages": [
         {
             "name": "aws/aws-crt-php",
@@ -168,6 +168,71 @@
             "time": "2023-12-22T19:07:47+00:00"
         },
         {
+            "name": "cmdotcom/text-sdk-php",
+            "version": "2.2.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cmdotcom/text-sdk-php.git",
+                "reference": "a0da69e6fd7d1854e46fc4098a92fea8ba80cc20"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cmdotcom/text-sdk-php/zipball/a0da69e6fd7d1854e46fc4098a92fea8ba80cc20",
+                "reference": "a0da69e6fd7d1854e46fc4098a92fea8ba80cc20",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "ext-curl": "*",
+                "ext-json": "*",
+                "php": "^7.0||^8.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~6.0||~9.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "CMText": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Niels Verbaken",
+                    "email": "nv@cm.nl",
+                    "role": "Developer"
+                }
+            ],
+            "description": "PHP SDK to send messages with CM.com",
+            "homepage": "https://www.cm.com/products/text/",
+            "keywords": [
+                "IMessage",
+                "cm.com",
+                "instagram",
+                "line",
+                "rcs",
+                "sms",
+                "twitter",
+                "viber",
+                "wechat",
+                "whatsapp"
+            ],
+            "support": {
+                "issues": "https://github.com/cmdotcom/text-sdk-php/issues",
+                "source": "https://github.com/cmdotcom/text-sdk-php/tree/2.2.1"
+            },
+            "time": "2022-12-16T12:03:19+00:00"
+        },
+        {
             "name": "easywechat-composer/easywechat-composer",
             "version": "1.4.1",
             "source": {

+ 4 - 0
vendor/cmdotcom/text-sdk-php/.gitignore

@@ -0,0 +1,4 @@
+
+vendor/
+
+*.lock

+ 23 - 0
vendor/cmdotcom/text-sdk-php/.travis.yml

@@ -0,0 +1,23 @@
+env:
+  global:
+    - XDEBUG_MODE=coverage
+
+language: php
+
+php:
+- 7.0
+- 7.1
+- 7.2
+- 7.3
+- 7.4
+- 8.0
+
+before_script:
+- travis_retry composer self-update
+- travis_retry composer install --no-interaction --prefer-source
+
+script:
+- vendor/bin/phpunit --coverage-clover=coverage.xml --whitelist=./src tests
+
+after_success:
+- bash <(curl -s https://codecov.io/bash)

+ 21 - 0
vendor/cmdotcom/text-sdk-php/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 CM.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 252 - 0
vendor/cmdotcom/text-sdk-php/README.md

@@ -0,0 +1,252 @@
+[![Build Status](https://travis-ci.com/cmdotcom/text-sdk-php.svg?branch=master)](https://travis-ci.com/cmdotcom/text-sdk-php)
+[![codecov](https://codecov.io/gh/cmdotcom/text-sdk-php/branch/master/graph/badge.svg)](https://codecov.io/gh/cmdotcom/text-sdk-php)
+[![Packagist](https://img.shields.io/packagist/dm/cmdotcom/text-sdk-php)](https://packagist.org/packages/cmdotcom/text-sdk-php)
+
+# CM Text SDK
+A software development kit to provide ways to interact with CM.com's Text service. API used:
+- [Business Messaging](https://docs.cmtelecom.com/business-messaging/v1.0)
+
+
+### Requirements
+
+- php 7.* or 8.0 or 8.1 or 8.2
+
+
+## Usage
+
+### 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');
+```
+
+### Send a message
+By calling `SendMessage` and providing message text, sender name, recipient phone number(s) and a reference (optional).
+
+```php
+$result = $client->SendMessage('Message_Text', 'CM.com', [ 'Recipient_PhoneNumber' ], 'Your_Reference');
+```
+
+### Get the result
+`SendMessage` and `send` return an object of type `TextClientResult`, example:
+
+```json
+{
+  "statusMessage": "Created 1 message(s)",
+  "statusCode": 201,
+  "details": [
+    {
+      "reference": "Example_Reference",
+      "status": "Accepted",
+      "to": "Example_PhoneNumber",
+      "parts": 1,
+      "details": null
+    },
+    {
+      "reference": "Example_Reference2",
+      "status": "Rejected",
+      "to": "Example_PhoneNumber2",
+      "parts": 0,
+      "details": "A body without content was found"
+    }
+  ]
+}
+```
+
+### Status codes
+For all possibly returned status codes, please reference the `TextClientStatusCodes` class.
+
+### Sending a rich message
+By using the `Message` class it is possible to create messages with media for channels such as WhatsApp and RCS
+```php
+$client = new TextClient('your-api-key');
+$message = new Message('Message Text', 'Sender_name', ['Recipient_PhoneNumber']);
+$message
+    ->WithChannels([Channels::WHATSAPP])
+    ->WithHybridAppKey('your-secret-hybrid-app-key')
+    ->WithRichMessage(
+        new MediaMessage(
+            'cm.com',
+            'https://avatars3.githubusercontent.com/u/8234794?s=200&v=4',
+            'image/png'
+        )
+    )
+    ->WithSuggestions([
+        new ReplySuggestion('Opt In', 'OK'),
+        new ReplySuggestion('Opt Out', 'STOP'),
+    ]);
+$result = $client->send( [$message] );
+```
+
+## Sending a WhatsApp template message
+By using the `Message` class it is possible to create template messages. Please note that this is WhatsApp only and your template needs to be approved before sending.
+For more info please check our documentation: https://docs.cmtelecom.com/en/api/business-messaging-api/1.0/index#whatsapp-template-message
+```php
+$client = new TextClient('your-api-key');
+$message = new Message('Message Text', 'Sender_name', ['Recipient_PhoneNumber']);
+$message
+    ->WithChannels([Channels::WHATSAPP])
+    ->WithTemplate(
+            new TemplateMessage(
+                new WhatsappTemplate(
+                    'namespace',
+                    'elementname',
+                    new Language('en'),
+                    [
+                        new ComponentBody([
+                            new ComponentParameterText('firstname')
+                        ])
+                    ]
+                )
+            )
+    );
+$result = $client->send( [$message] );
+```
+
+## Sending a rich WhatsApp template message
+It is also possible to send a rich template with an image!			
+
+```php
+$client = new TextClient('your-api-key');
+$message = new Message('Message Text', 'Sender_name', ['Recipient_PhoneNumber']);
+$message
+    ->WithChannels([Channels::WHATSAPP])
+    ->WithTemplate(
+        new TemplateMessage(
+            new WhatsappTemplate(
+                'template-name',
+                'the-namespace-of-template',
+                new Language('en'),
+                [
+                    new ComponentHeader([
+                        new ComponentParameterImage(
+                            new MediaContent(
+                                'image name',
+                                'https://image.location',
+                                'image/png'
+                            )
+                        )
+                    ]),
+                    new ComponentBody([
+                        new ComponentParameterText('firstname')
+                    ])
+                ]
+            )
+        )
+    );
+$result = $client->send( [$message] );
+```
+
+## Sending an Apple Pay Request
+It is now possible to send an apple pay request only possible in Apple Business Chat
+
+```php
+$client = new TextClient('your-api-key');
+$message = new Message('Message Text', 'Sender_name', ['Recipient_PhoneNumber']);
+$message
+    ->WithChannels([Channels::IMESSAGE])
+    ->WithPayment(
+        new PaymentMessage(
+            new ApplePayConfiguration(
+                'merchant-name',
+                'product-description',
+                'unique-order-guid',
+                1,
+                'currency-code',
+                'recipient-email',
+                'recipient-country-code',
+                'language-country-code',
+                true,
+                true,
+                [
+                    new LineItem(
+                        'product-name',
+                        'final-or-pending',
+                        1
+                    )
+                ]
+            )
+        )
+    );
+$result = $client->send( [$message] );
+```
+
+## Sending WhatsApp interactive messages
+It is now possible to send list messages and reply buttons without using templates
+only supported in WhatsApp
+
+```php
+$client = new TextClient('your-api-key');
+$message = new Message('Message Text', 'Sender_name', ['Recipient_PhoneNumber']);
+$message
+    ->WithChannels([Channels::WHATSAPP])
+    ->WithRichMessage(
+        new WhatsAppInteractiveMessage(
+            new WhatsAppInteractiveContent(
+                WhatsAppInteractiveContentTypes::LIST,
+                new WhatsAppInteractiveHeader(
+                    WhatsAppInteractiveHeaderTypes::TEXT,
+                    'List message example'
+                ),
+                new WhatsAppInteractiveBody('checkout our list message demo'),
+                new WhatsAppInteractiveListAction(
+                    'Descriptive list title',
+                    [new WhatsAppInteractiveSection(
+                        'Select an option',
+                        [new WhatsAppInteractiveSectionRow(
+                            'unique title 1',
+                            rand(),
+                            'description text'
+                        ),new WhatsAppInteractiveSectionRow(
+                            'unique title 2',
+                            rand()
+                        )]
+                    )]
+                ),
+                new WhatsAppInteractiveFooter('footer text')
+            )
+        )
+    );
+$result = $client->send( [$message] );
+```
+
+Only with Reply buttons you can send media like image,video or document
+see following example.
+
+```php
+$client = new TextClient('your-api-key');
+$message = new Message('Message Text', 'Sender_name', ['Recipient_PhoneNumber']);
+$message
+    ->WithChannels([Channels::WHATSAPP])
+    ->WithRichMessage(
+        new WhatsAppInteractiveMessage(
+            new WhatsAppInteractiveContent(
+                WhatsAppInteractiveContentTypes::BUTTON,
+                new WhatsAppInteractiveHeader(
+                    WhatsAppInteractiveHeaderTypes::IMAGE,
+                    null,
+                    new MediaContent(
+                        'media name',
+                        'media.url',
+                        'mime/type'
+                    )
+                ),
+                new WhatsAppInteractiveBody('checkout our list message demo'),
+                new WhatsAppInteractiveButtonAction(
+                    [new WhatsAppInteractiveReplyButton(
+                        'button 1 reply-text',
+                        rand()
+                    ),new WhatsAppInteractiveReplyButton(
+                        'button 2 title',
+                        rand()
+                    )]
+                ),
+                new WhatsAppInteractiveFooter('footer text')
+            )
+        )
+    );
+$result = $client->send( [$message] );
+```

+ 29 - 0
vendor/cmdotcom/text-sdk-php/composer.json

@@ -0,0 +1,29 @@
+{
+    "name": "cmdotcom/text-sdk-php",
+    "description": "PHP SDK to send messages with CM.com",
+    "type": "library",
+    "version": "2.2.1",
+    "keywords": ["sms","cm.com","rcs","whatsapp","viber","line","wechat","imessage","twitter","instagram"],
+    "homepage": "https://www.cm.com/products/text/",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Niels Verbaken",
+            "email": "nv@cm.nl",
+            "role": "Developer"
+        }
+    ],
+    "require": {
+        "ext-curl": "*",
+        "ext-json": "*",
+        "php": "^7.0||^8.0"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "~6.0||~9.0"
+    },
+    "autoload": {
+        "psr-0": {
+            "CMText": "src/"
+        }
+    }
+}

+ 19 - 0
vendor/cmdotcom/text-sdk-php/example/example.php

@@ -0,0 +1,19 @@
+<?php
+/**
+ * run Composer first to install the sdk with all it's dependencies in your project. (getcomposer.org)
+ *   composer install
+ */
+require_once "../vendor/autoload.php";
+
+/**
+ * initiate the TextClient.
+ * put in your own api-key for authentication.
+ */
+$client = new \CMText\TextClient('your-api-key');
+
+/**
+ * send a message and get the JSON output returned to your command line.
+ */
+echo json_encode(
+    $client->SendMessage('Message_Text', 'CM.com', [ 'Recipient_PhoneNumber' ], 'Your_Reference')
+);

+ 103 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Channels.php

@@ -0,0 +1,103 @@
+<?php
+
+namespace CMText;
+
+
+/**
+ * Class Channels
+ *
+ * Contains all known Channels
+ *
+ * @package CMText
+ */
+class Channels
+{
+    /**
+     * Send SMS messages.
+     */
+    const SMS = 'SMS';
+
+    /**
+     * Send WhatsApp for Business messages.
+     * @note CM needs to configure this with you.
+     */
+    const WHATSAPP = 'WhatsApp';
+
+    /**
+     * Send Push messages using Hybrid messages.
+     */
+    const PUSH = 'Push';
+
+    /**
+     * Send RCS messages.
+     * @note CM needs to configure this with you.
+     */
+    const RCS = 'RCS';
+
+    /**
+     * Send Viber messages.
+     * @note CM needs to configure this with you.
+     */
+    const VIBER = 'Viber';
+
+    /**
+     * Send Voice messages.
+     * @note CM needs to configure this with you.
+     */
+    const VOICE = 'Voice';
+
+    /**
+     * 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.
+     */
+    const LINE = 'Line';
+
+    /**
+     * Send Twitter messages.
+     * @note CM needs to configure this with you.
+     */
+    const TWITTER = 'Twitter';
+
+    /**
+     * Send MobilePush messages.
+     * @note This channel is the successor of the "Push" channel. Contact CM for information on how to migrate your current Push integration
+     */
+    const MOBILEPUSH = 'MobilePush';
+
+    /**
+     * Send Facebook Messenger messages.
+     * @note CM needs to configure this with you.
+     */
+    const FACEBOOKMESSENGER = 'Facebook Messenger';
+
+    /**
+     * Send Google Business Messages messages.
+     * @note CM needs to configure this with you.
+     */
+    const GOOGLEBUSINESSMESSAGES = 'Google Business Messages';
+
+    /**
+     * Send Instagram messages.
+     * @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 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactAddressException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class ContactAddressException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactEmailException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class ContactEmailException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class ContactException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactPhonenumberException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class ContactPhonenumberException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ContactUrlException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class ContactUrlException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/ConversationLimitException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class ConversationLimitException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/MessagesLimitException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class MessagesLimitException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/RecipientLimitException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class RecipientLimitException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/SuggestionsLimitException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class SuggestionsLimitException extends \Exception
+{
+
+}

+ 9 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Exceptions/WhatsappTemplateComponentParameterTypeException.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace CMText\Exceptions;
+
+
+class WhatsappTemplateComponentParameterTypeException extends \Exception
+{
+
+}

+ 41 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Gateways.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace CMText;
+
+
+/**
+ * Class Gateways
+ *
+ * Contains endpoints to CM gateways
+ *
+ * @package CMText
+ */
+class Gateways
+{
+
+    /**
+     * Gateway that fits most use cases
+     */
+    const GLOBAL = 'https://gw.cmtelecom.com/v1.0/message';
+
+    /**
+     * China local gateway
+     */
+    const CN = 'https://gw-cn.cmtelecom.com/v1.0/message';
+
+    /**
+     * Hong Kong local gateway
+     */
+    const HK = 'https://gw-hk.cmtelecom.cn/v1.0/message';
+
+    /**
+     * United Kingdom local gateway
+     */
+    const UK = 'https://gw-uk.cmtelecom.com/v1.0/message';
+
+    /**
+     * South Africa local gateway
+     */
+    const ZA = 'https://gw.cmtelecom.co.za/v1.0/message';
+
+}

+ 47 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/ITextClient.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace CMText;
+
+
+interface ITextClient
+{
+    /**
+     * ITextClient constructor.
+     *
+     * @param string $apiKey
+     * @param string $gateway
+     */
+    public function __construct(
+        string $apiKey,
+        $gateway = Gateways::GLOBAL
+    );
+
+    /**
+     * Fast and easy method to instantly send one message.
+     *
+     * @param string $message - Message body to send
+     * @param string $from - Sender name
+     * @param array $to - Recipient phonenumbers
+     * @param string $reference optional
+     *
+     * @return TextClientResult
+     */
+    public function SendMessage(
+        string $message,
+        string $from,
+        array $to,
+        string $reference = null
+    );
+
+    /**
+     * Send an array of Message objects.
+     *
+     * @param array $messages Array of Message objects
+     *
+     * @return TextClientResult
+     * @throws \CMText\Exceptions\MessagesLimitException
+     */
+    public function send(
+        array $messages
+    );
+}

+ 316 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/Message.php

@@ -0,0 +1,316 @@
+<?php
+
+namespace CMText;
+
+
+use CMText\Exceptions\RecipientLimitException;
+use CMText\RichContent\Messages\IRichMessage;
+use CMText\RichContent\Messages\PaymentMessage;
+use CMText\RichContent\Messages\TemplateMessage;
+use CMText\RichContent\RichContent;
+use JsonSerializable;
+
+/**
+ * Class Message
+ *
+ * @package CMText
+ */
+class Message implements JsonSerializable
+{
+
+    /**
+     * @var \CMText\MessageBody
+     */
+    private $body;
+
+    /**
+     * @var string Grouping field for message statistics
+     */
+    private $customgrouping3;
+
+    /**
+     * @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;
+
+    /**
+     * @var string Reference for message lookup and identification
+     */
+    private $reference;
+
+    /**
+     * @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 = [];
+
+    /**
+     * @var int Minimum number of message parts for SMS concatenation
+     */
+    private $minimumNumberOfMessageParts;
+
+    /**
+     * @var int Maximum number of message parts for SMS concatenation
+     */
+    private $maximumNumberOfMessageParts;
+
+    /**
+     * @var string Hybrid App Key for use with CM Hybrid Messaging product
+     */
+    private $hybridAppKey;
+
+    /**
+     * @var array Channels that are exclusively used for delivering this message.
+     */
+    private $allowedChannels = [];
+
+    /**
+     * @var RichContent
+     */
+    private $richContent;
+
+    /**
+     * @var int Optional Data Coding Scheme property for SMS messages.
+     */
+    private $dcs;
+
+    /**
+     * Fallback value for Sender
+     */
+    const SENDER_FALLBACK = 'cm.com';
+
+    /**
+     * Default values for Minimum and Maximum amount of message parts
+     */
+    const MESSAGEPARTS_MINIMUM = 1;
+    const MESSAGEPARTS_MAXIMUM = 8;
+
+    /**
+     * Recipients limit per request
+     */
+    const RECIPIENTS_MAXIMUM = 1000;
+
+
+    /**
+     * Message constructor.
+     *
+     * @param string|MessageBody $body
+     * @param string|null $from
+     * @param array $to
+     * @param string|null $reference
+     * @throws \CMText\Exceptions\RecipientLimitException
+     */
+    public function __construct($body = '', string $from = null, array $to = [], string $reference = null)
+    {
+        $this->__set('body', $body);
+        $this->__set('from', $from);
+        $this->__set('reference', $reference);
+        $this->__set('to', $to);
+
+        $this->__set('minimumNumberOfMessageParts', self::MESSAGEPARTS_MINIMUM);
+        $this->__set('maximumNumberOfMessageParts', self::MESSAGEPARTS_MAXIMUM);
+
+        $this->customgrouping3 = 'text-sdk-php-' . TextClient::VERSION;
+    }
+
+
+    /**
+     * Setters for a limited set of properties
+     * @param string $name
+     * @param mixed $value
+     * @throws \CMText\Exceptions\RecipientLimitException
+     */
+    public function __set(string $name, $value)
+    {
+        switch ($name){
+            case 'body':
+                if($value instanceof MessageBody){
+                    $this->body = $value;
+                }else{
+                    $this->body = new MessageBody($value);
+                }
+                break;
+
+            case 'from':
+                $this->{$name} = $value ?? self::SENDER_FALLBACK;;
+                break;
+
+            case 'minimumNumberOfMessageParts':
+            case 'maximumNumberOfMessageParts':
+            case 'reference':
+            case 'dcs':
+                $this->{$name} = $value;
+                break;
+
+            case 'to':
+                $this->AddRecipients($value);
+                break;
+        }
+    }
+
+
+    /**
+     * Add an array of Recipients
+     * @param array $Recipients
+     * @return array
+     * @throws \CMText\Exceptions\RecipientLimitException
+     */
+    public function AddRecipients(array $Recipients)
+    {
+        if( (count($Recipients) + count($this->to)) > self::RECIPIENTS_MAXIMUM){
+            throw new RecipientLimitException('Maximum amount of Recipients exceeded. ('. self::RECIPIENTS_MAXIMUM .')');
+        }
+
+        return $this->to = array_merge([], $Recipients, $this->to);
+    }
+
+
+    /**
+     * Force a message to use only the provided set of Channels by setting this.
+     * @param array $Channels
+     * @return $this
+     */
+    public function WithChannels(array $Channels)
+    {
+        $supportedChannels = array_intersect(
+            (new \ReflectionClass(Channels::class))->getConstants(),
+            $Channels
+        );
+
+        $this->allowedChannels = array_unique(array_merge($this->allowedChannels, array_values($supportedChannels)));
+
+        return $this;
+    }
+
+
+    /**
+     * Add a RichContent message which replaces the Body for channels that support rich content.
+     * @param \CMText\RichContent\Messages\IRichMessage $richMessage
+     * @return $this
+     * @throws \CMText\Exceptions\ConversationLimitException
+     */
+    public function WithRichMessage(IRichMessage $richMessage){
+        if(null === $this->richContent){
+            $this->richContent = new RichContent();
+        }
+
+        $this->richContent->AddConversationPart($richMessage);
+        return $this;
+    }
+
+
+    /**
+     * Add a Suggestion to a message. Supported Suggestion types depend on the Channel used.
+     * @param array $suggestions
+     * @return $this
+     * @throws \CMText\Exceptions\SuggestionsLimitException
+     */
+    public function WithSuggestions(array $suggestions){
+        if(null === $this->richContent){
+            $this->richContent = new RichContent();
+        }
+
+        foreach ($suggestions as $suggestion){
+            $this->richContent->AddSuggestion($suggestion);
+        }
+
+        return $this;
+    }
+
+
+    /**
+     * Set your Hybrid App Key.
+     * @param string $Key
+     * @return $this
+     */
+    public function WithHybridAppKey(string $Key)
+    {
+        $this->hybridAppKey = $Key;
+        return $this;
+    }
+
+
+    /**
+     * @param \CMText\RichContent\Messages\TemplateMessage $template
+     * @return $this
+     * @throws \CMText\Exceptions\ConversationLimitException
+     */
+    public function WithTemplate(TemplateMessage $template)
+    {
+        if( !$this->richContent ){
+            $this->richContent = new RichContent();
+        }
+
+        $this->richContent->AddConversationPart($template);
+        return $this;
+    }
+
+
+    /**
+     * @param \CMText\RichContent\Messages\PaymentMessage $paymentMessage
+     * @return $this
+     * @throws \CMText\Exceptions\ConversationLimitException
+     */
+    public function WithPayment(PaymentMessage $paymentMessage)
+    {
+        if( !$this->richContent ){
+            $this->richContent = new RichContent();
+        }
+
+        $this->richContent->AddConversationPart($paymentMessage);
+        return $this;
+    }
+
+
+    /**
+     * @return object
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        $return = [
+            'body'      => $this->body,
+            'from'      => $this->from,
+            'to'        => array_map(function ($number){
+                return (object)[
+                    'number' => $number,
+                ];
+            }, $this->to),
+            'customgrouping3' => $this->customgrouping3,
+            'minimumNumberOfMessageParts' => $this->minimumNumberOfMessageParts,
+            'maximumNumberOfMessageParts' => $this->maximumNumberOfMessageParts,
+        ];
+
+        if( count($this->allowedChannels) ){
+            $return['allowedChannels'] = $this->allowedChannels;
+        }
+
+        if( null !== $this->hybridAppKey ){
+            $return['appKey'] = $this->hybridAppKey;
+        }
+
+        if( null !== $this->richContent ){
+            $return['richContent'] = $this->richContent;
+        }
+
+        if( null !== $this->reference ){
+            $return['reference'] = $this->reference;
+        }
+
+        if( null !== $this->dcs ){
+            $return['dcs'] = $this->dcs;
+        }
+
+        return (object)$return;
+    }
+}

+ 98 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/MessageBody.php

@@ -0,0 +1,98 @@
+<?php
+
+namespace CMText;
+
+
+use JsonSerializable;
+
+/**
+ * Class MessageBody
+ *
+ * @package CMText
+ */
+class MessageBody implements JsonSerializable
+{
+
+    /**
+     * @var string
+     */
+    private $content;
+
+    /**
+     * @var string
+     */
+    private $type;
+
+
+    /**
+     * MessageBody constructor.
+     * @param string $content
+     * @param string $type
+     */
+    public function __construct(string $content, string $type = MessageBodyTypes::AUTO)
+    {
+        $this->__set('content', $content);
+        $this->__set('type', $type);
+    }
+
+
+    /**
+     * Setters providing sanitized results
+     *
+     * @param $name
+     * @param $value
+     * @return void
+     */
+    public function __set($name, $value)
+    {
+        switch ($name){
+            case 'type':
+                if( in_array(
+                    $value,
+                    (new \ReflectionClass(MessageBodyTypes::class))->getConstants()
+                ) ){
+                    $this->type = $value;
+                }else{
+                    $this->type = MessageBodyTypes::AUTO;
+                }
+                break;
+
+            case 'content':
+                // try to make sure the content as Json-compatible as possible
+                if( function_exists('mb_convert_encoding') && function_exists('mb_detect_encoding') ){
+                    $value = mb_convert_encoding(
+                        $value,
+                        'UTF-8',
+                        mb_detect_encoding($value)
+                    );
+                }
+
+                $this->content = $value;
+                break;
+        }
+    }
+
+
+    /**
+     * @param string $type
+     * @return $this
+     */
+    public function WithType(string $type): MessageBody
+    {
+        $this->__set('type', $type);
+        return $this;
+    }
+
+
+    /**
+     * @return object
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'content' => $this->content,
+            'type' => $this->type,
+        ];
+    }
+}

+ 30 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/MessageBodyTypes.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace CMText;
+
+
+/**
+ * Class MessageBodyTypes
+ *
+ * @package CMText
+ */
+class MessageBodyTypes
+{
+
+    /**
+     * The CM.com gateway will determine the best suited encoding for the message content.
+     * This way you do not have to take care of character count and the GSM character set.
+     */
+    const AUTO = 'AUTO';
+
+    /**
+     * When sending binary messages (to machines) use this to make sure no encoding takes place.
+     */
+    const BINARY = 'BINARY';
+
+    /**
+     * When using only characters from the GMS 7bit character set you can use this Type.
+     */
+    const TEXT = 'TEXT';
+
+}

+ 186 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/Contact.php

@@ -0,0 +1,186 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+use CMText\Exceptions\ContactException;
+
+/**
+ * Class Contact
+ * @package CMText\RichContent\Common
+ */
+class Contact implements \JsonSerializable
+{
+    /**
+     * @var \CMText\RichContent\Common\ContactAddress[]
+     */
+    private $addresses = [];
+
+    /**
+     * @var \CMText\RichContent\Common\ContactBirthday
+     */
+    private $birthday;
+
+    /**
+     * @var \CMText\RichContent\Common\ContactEmail[]
+     */
+    private $emails = [];
+
+    /**
+     * @var \CMText\RichContent\Common\ContactName
+     */
+    private $name;
+
+    /**
+     * @var \CMText\RichContent\Common\ContactOrganization
+     */
+    private $organization;
+
+    /**
+     * @var \CMText\RichContent\Common\ContactPhonenumber[]
+     */
+    private $phones = [];
+
+    /**
+     * @var \CMText\RichContent\Common\ContactUrl[]
+     */
+    private $urls = [];
+
+    /**
+     * Contact constructor.
+     * @param mixed ...$arguments
+     * @throws \CMText\Exceptions\ContactException
+     */
+    public function __construct(...$arguments)
+    {
+        foreach ($arguments as $argument) {
+            $switchKey = get_class( is_array($argument) ? (object)$argument[0] : (object)$argument);
+
+            switch ($switchKey) {
+                case ContactAddress::class: // accepts an array of ContactAddress objects.
+                    if (is_object($argument)) {
+                        $argument = [$argument];
+                    }
+                    foreach ($argument as $address) {
+                        $this->addAddress($address);
+                    }
+                    break;
+
+                case ContactBirthday::class:
+                    $this->setBirthday($argument);
+                    break;
+
+                case ContactEmail::class: // accepts an array of ContactEmail objects.
+                    if (is_object($argument)) {
+                        $argument = [$argument];
+                    }
+                    foreach ($argument as $email) {
+                        $this->addEmail($email);
+                    }
+                    break;
+
+                case ContactName::class:
+                    $this->setName($argument);
+                    break;
+
+                case ContactOrganization::class:
+                    $this->setOrganization($argument);
+                    break;
+
+                case ContactPhonenumber::class: // accepts an array of ContactPhonenumber objects.
+                    if (is_object($argument)) {
+                        $argument = [$argument];
+                    }
+                    foreach ($argument as $phonenumber) {
+                        $this->addPhonenumber($phonenumber);
+                    }
+                    break;
+
+                case ContactUrl::class: // accepts an array of ContactUrl objects.
+                    if (is_object($argument)) {
+                        $argument = [$argument];
+                    }
+                    foreach ($argument as $url) {
+                        $this->addUrl($url);
+                    }
+                    break;
+
+                default:
+                    throw new ContactException('Unknown Argument Type ' . $argument);
+            }
+        }
+    }
+
+    /**
+     * @param \CMText\RichContent\Common\ContactAddress $ContactAddress
+     */
+    public function addAddress(ContactAddress $ContactAddress)
+    {
+        $this->addresses[] = $ContactAddress;
+    }
+
+    /**
+     * @param \CMText\RichContent\Common\ContactBirthday $ContactBirthday
+     */
+    public function setBirthday(ContactBirthday $ContactBirthday)
+    {
+        $this->birthday = $ContactBirthday;
+    }
+
+    /**
+     * @param \CMText\RichContent\Common\ContactEmail $ContactEmail
+     */
+    public function addEmail(ContactEmail $ContactEmail)
+    {
+        $this->emails[] = $ContactEmail;
+    }
+
+    /**
+     * @param \CMText\RichContent\Common\ContactName $ContactName
+     */
+    public function setName(ContactName $ContactName)
+    {
+        $this->name = $ContactName;
+    }
+
+    /**
+     * @param \CMText\RichContent\Common\ContactOrganization $ContactOrganization
+     */
+    public function setOrganization(ContactOrganization $ContactOrganization)
+    {
+        $this->organization = $ContactOrganization;
+    }
+
+    /**
+     * @param \CMText\RichContent\Common\ContactPhonenumber $ContactPhonenumber
+     */
+    public function addPhonenumber(ContactPhonenumber $ContactPhonenumber)
+    {
+        $this->phones[] = $ContactPhonenumber;
+    }
+
+    /**
+     * @param \CMText\RichContent\Common\ContactUrl $ContactUrl
+     */
+    public function addUrl(ContactUrl $ContactUrl)
+    {
+        $this->urls[] = $ContactUrl;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        // none of the properties are required, so we filter the empty ones.
+        return (object)array_filter([
+            'addresses' => array_filter($this->addresses),
+            'birthday' => $this->birthday,
+            'emails' => array_filter($this->emails),
+            'name' => $this->name,
+            'org' => $this->organization,
+            'phones' => array_filter($this->phones),
+            'urls' => array_filter($this->urls),
+        ]);
+    }
+}

+ 112 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactAddress.php

@@ -0,0 +1,112 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+use CMText\Exceptions\ContactAddressException;
+
+/**
+ * Class ContactAddress
+ * @package CMText\RichContent\Common
+ */
+class ContactAddress implements \JsonSerializable
+{
+    /**
+     * @var string
+     */
+    private $city;
+
+    /**
+     * @var string
+     */
+    private $country;
+
+    /**
+     * @var string
+     */
+    private $country_code;
+
+    /**
+     * @var string
+     */
+    private $state;
+
+    /**
+     * @var string
+     */
+    private $street;
+
+    /**
+     * @var string
+     */
+    private $type;
+
+    /**
+     * @var string
+     */
+    private $zip;
+
+    const COUNTRYCODE_MAX_LENGTH = 3;
+
+    /**
+     * ContactAddress constructor.
+     * @param string $City
+     * @param string $Country
+     * @param string $CountryCode
+     * @param string $State
+     * @param string $Street
+     * @param string $Type
+     * @param string $Zip
+     * @throws \CMText\Exceptions\ContactAddressException
+     */
+    public function __construct(
+        string $City = '',
+        string $Country = '',
+        string $CountryCode = '',
+        string $State = '',
+        string $Street = '',
+        string $Type = '',
+        string $Zip = ''
+    )
+    {
+        if (strlen($CountryCode) > self::COUNTRYCODE_MAX_LENGTH) {
+            throw new ContactAddressException('Invalid CountryCode');
+        }
+
+        if (!in_array(
+            $Type,
+            [
+                ContactAddressTypes::HOME,
+                ContactAddressTypes::WORK,
+                '', // no value provided is allowed as well
+            ]
+        )) {
+            throw new ContactAddressException('Unknown ContactAddress Type');
+        }
+
+        $this->city = $City;
+        $this->country = $Country;
+        $this->country_code = $CountryCode;
+        $this->state = $State;
+        $this->street = $Street;
+        $this->type = $Type;
+        $this->zip = $Zip;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        // none of these properties are required, so we filter the empty ones.
+        return (object)array_filter([
+            'city' => $this->city,
+            'country' => $this->country,
+            'country_code' => $this->country_code,
+            'state' => $this->state,
+            'street' => $this->street,
+            'type' => $this->type,
+            'zip' => $this->zip,
+        ]);
+    }
+}

+ 13 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactAddressTypes.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ContactAddressTypes
+ * @package CMText\RichContent\Common
+ */
+class ContactAddressTypes
+{
+    const HOME = 'HOME';
+    const WORK = 'WORK';
+}

+ 33 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactBirthday.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ContactBirthday
+ * @package CMText\RichContent\Common
+ */
+class ContactBirthday implements \JsonSerializable
+{
+    /**
+     * @var \DateTimeInterface
+     */
+    private $date;
+
+    /**
+     * ContactBirthday constructor.
+     * @param \DateTimeInterface $Birthday
+     */
+    public function __construct(\DateTimeInterface $Birthday)
+    {
+        $this->date = $Birthday;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return $this->date->format('Y-m-d');
+    }
+}

+ 62 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactEmail.php

@@ -0,0 +1,62 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+use CMText\Exceptions\ContactEmailException;
+
+/**
+ * Class ContactEmail
+ * @package CMText\RichContent\Common
+ */
+class ContactEmail implements \JsonSerializable
+{
+    /**
+     * @var string
+     */
+    private $email;
+
+    /**
+     * @var string
+     */
+    private $type;
+
+    /**
+     * ContactEmail constructor.
+     * @param string $Email
+     * @param string $Type
+     * @throws \CMText\Exceptions\ContactEmailException
+     */
+    public function __construct(string $Email = '', string $Type = '')
+    {
+        if(!filter_var($Email, FILTER_VALIDATE_EMAIL)){
+            throw new ContactEmailException('Invalid Email');
+        }
+
+        if (!in_array(
+            $Type,
+            [
+                ContactEmailTypes::HOME,
+                ContactEmailTypes::WORK,
+                '',  // no value provided is accepted as well.
+            ]
+        )) {
+            throw new ContactEmailException('Unknown ContactEmail Type');
+        }
+
+        $this->email = $Email;
+        $this->type = $Type;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        // none of these properties are required, so we filter the empty ones.
+        return (object)array_filter([
+            'email' => $this->email,
+            'type' => $this->type,
+        ]);
+    }
+}

+ 13 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactEmailTypes.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ContactEmailTypes
+ * @package CMText\RichContent\Common
+ */
+class ContactEmailTypes
+{
+    const HOME = 'HOME';
+    const WORK = 'WORK';
+}

+ 90 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactName.php

@@ -0,0 +1,90 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ContactName
+ * @package CMText\RichContent\Common
+ */
+class ContactName implements \JsonSerializable
+{
+    /**
+     * @var string
+     */
+    private $formatted = '';
+
+    /**
+     * @var string
+     */
+    private $first;
+
+    /**
+     * @var string
+     */
+    private $last;
+
+    /**
+     * @var string
+     */
+    private $middle;
+
+    /**
+     * @var string
+     */
+    private $prefix;
+
+    /**
+     * @var string
+     */
+    private $suffix;
+
+    /**
+     * ContactName constructor.
+     * @param string $FormattedName
+     * @param string $FirstName
+     * @param string $LastName
+     * @param string $MiddleName
+     * @param string $NamePrefix
+     * @param string $NameSuffix
+     */
+    public function __construct(
+        string $FormattedName,
+        string $FirstName = '',
+        string $LastName = '',
+        string $MiddleName = '',
+        string $NamePrefix = '',
+        string $NameSuffix = ''
+    )
+    {
+        $this->formatted = $FormattedName;
+        $this->first = $FirstName;
+        $this->last = $LastName;
+        $this->middle = $MiddleName;
+        $this->prefix = $NamePrefix;
+        $this->suffix = $NameSuffix;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        $required = [
+            'formatted_name' => $this->formatted,
+        ];
+
+        $optional = array_filter([
+            'first_name' => $this->first,
+            'last_name' => $this->last,
+            'middle_name' => $this->middle,
+            'name_prefix' => $this->prefix,
+            'name_suffix' => $this->suffix,
+        ]);
+
+        return (object)array_merge(
+            $required,
+            $optional
+        );
+    }
+}

+ 56 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactOrganization.php

@@ -0,0 +1,56 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ContactOrganization
+ * @package CMText\RichContent\Common
+ */
+class ContactOrganization implements \JsonSerializable
+{
+    /**
+     * @var string
+     */
+    private $company;
+
+    /**
+     * @var string
+     */
+    private $department;
+
+    /**
+     * @var string
+     */
+    private $title;
+
+    /**
+     * ContactOrganization constructor.
+     * @param string $Company
+     * @param string $Department
+     * @param string $Title
+     */
+    public function __construct(
+        string $Company = '',
+        string $Department = '',
+        string $Title = ''
+    )
+    {
+        $this->company = $Company;
+        $this->department = $Department;
+        $this->title = $Title;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        // none of the properties are required, so we filter the empty ones.
+        return (object)array_filter([
+            'company' => $this->company,
+            'department' => $this->department,
+            'title' => $this->title,
+        ]);
+    }
+}

+ 61 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactPhonenumber.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+use CMText\Exceptions\ContactPhonenumberException;
+
+/**
+ * Class ContactPhonenumber
+ * @package CMText\RichContent\Common
+ */
+class ContactPhonenumber implements \JsonSerializable
+{
+    /**
+     * @var string
+     */
+    private $phone;
+
+    /**
+     * @var string A value from ContactPhonenumberTypes
+     */
+    private $type;
+
+    /**
+     * ContactPhonenumber constructor.
+     * @param string $Phone
+     * @param string $PhonenumberType
+     * @throws \CMText\Exceptions\ContactPhonenumberException
+     */
+    public function __construct(string $Phone = '', string $PhonenumberType = '')
+    {
+        if(!in_array(
+            $PhonenumberType,
+            [
+                ContactPhonenumberTypes::CELL,
+                ContactPhonenumberTypes::MAIN,
+                ContactPhonenumberTypes::HOME,
+                ContactPhonenumberTypes::IPHONE,
+                ContactPhonenumberTypes::WORK,
+                '', // no value provided is allowed.
+            ]
+        )){
+            throw new ContactPhonenumberException('Unknown Phonenumber Type');
+        }
+
+        $this->phone = $Phone;
+        $this->type = $PhonenumberType;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        // none of the properties are required, so we filter the empty ones.
+        return (object)array_filter([
+            'phone' => $this->phone,
+            'type' => $this->type,
+        ]);
+    }
+}

+ 16 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactPhonenumberTypes.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ContactPhonenumberTypes
+ * @package CMText\RichContent\Common
+ */
+class ContactPhonenumberTypes
+{
+    const CELL = 'CELL';
+    const MAIN = 'MAIN';
+    const IPHONE = 'IPHONE';
+    const HOME = 'HOME';
+    const WORK = 'WORK';
+}

+ 51 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ContactUrl.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+use CMText\Exceptions\ContactUrlException;
+
+/**
+ * Class ContactUrl
+ * @package CMText\RichContent\Common
+ */
+class ContactUrl implements \JsonSerializable
+{
+    /**
+     * @var string
+     */
+    private $url;
+
+    /**
+     * @var string
+     */
+    private $type;
+
+    /**
+     * ContactUrl constructor.
+     * @param string $Url
+     * @param string $Type
+     * @throws \CMText\Exceptions\ContactUrlException
+     */
+    public function __construct(string $Url, string $ContactUrlType = '')
+    {
+        if(!filter_var($Url, FILTER_VALIDATE_URL)){
+            throw new ContactUrlException('Invalid Url');
+        }
+
+        $this->type = $ContactUrlType;
+        $this->url  = $Url;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        // none of the properties are required, so we filter the empty ones.
+        return (object)array_filter([
+            'url' => $this->url,
+            'type' => $this->type,
+        ]);
+    }
+}

+ 52 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/LineItem.php

@@ -0,0 +1,52 @@
+<?php
+
+
+namespace CMText\RichContent\Common;
+
+
+class LineItem implements \JsonSerializable
+{
+    /**
+     * (Required) A short, localized description of the line item.
+     * @var string
+     */
+    public $label;
+
+    /**
+     * A value that indicates whether the line item is final or pending.
+     * @var string
+     */
+    public $type;
+
+    /**
+     * (Required) The monetary amount of the line item.
+     * @var float
+     */
+    public $amount;
+
+    /**
+     * LineItem constructor.
+     * @param string $Label
+     * @param string $Type
+     * @param float $Amount
+     */
+    public function __construct(
+        string $Label,
+        string $Type,
+        float $Amount
+    )
+    {
+        $this->label = $Label;
+        $this->type = $Type;
+        $this->amount = $Amount;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return $this;
+    }
+}

+ 40 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ViewLocationBase.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ViewLocationBase
+ * @package CMText\RichContent\Common
+ */
+abstract class ViewLocationBase implements \JsonSerializable
+{
+    /**
+     * @var string
+     */
+    protected $label;
+
+    /**
+     * @var int Available in some RCS channels to display a radius instead of a pointer on the map.
+     */
+    protected $radius;
+
+    /**
+     * @const int Value to force omitting the radius attribute.
+     */
+    const RADIUS_OMIT_VALUE = -1;
+
+    /**
+     * ViewLocationBase constructor.
+     * @param string $Label
+     * @param int $Radius
+     */
+    public function __construct(
+        $Label,
+        $Radius = self::RADIUS_OMIT_VALUE
+    )
+    {
+        $this->label = $Label;
+
+        $this->radius = $Radius;
+    }
+}

+ 48 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ViewLocationDynamic.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ViewLocationDynamic
+ * @package CMText\RichContent\Common
+ */
+class ViewLocationDynamic extends ViewLocationBase
+{
+    /**
+     * @var string Search-query to find the location via a search engine
+     */
+    private $searchQuery;
+
+
+    /**
+     * ViewLocationDynamic constructor.
+     * @param string $Label
+     * @param string $SearchQuery
+     * @param int $Radius
+     */
+    public function __construct(
+        $Label,
+        $SearchQuery,
+        $Radius = ViewLocationBase::RADIUS_OMIT_VALUE
+    )
+    {
+        parent::__construct($Label, $Radius);
+
+        $this->searchQuery = $SearchQuery;
+    }
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        $return = [
+            'label' => $this->label,
+            'searchQuery' => $this->searchQuery,
+        ];
+
+        if($this->radius > ViewLocationBase::RADIUS_OMIT_VALUE){
+            $return['radius'] = $this->radius;
+        }
+
+        return (object)$return;
+    }
+}

+ 58 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Common/ViewLocationStatic.php

@@ -0,0 +1,58 @@
+<?php
+
+namespace CMText\RichContent\Common;
+
+/**
+ * Class ViewLocationStatic
+ * @package CMText\RichContent\Common
+ */
+class ViewLocationStatic extends ViewLocationBase
+{
+    /**
+     * @var string Latitude of location
+     */
+    private $latitude;
+
+    /**
+     * @var string Longitude of location
+     */
+    private $longitude;
+
+
+    /**
+     * ViewLocationOptions constructor.
+     * @param string $Label
+     * @param string $Latitude
+     * @param string $Longitude
+     * @param int $Radius
+     */
+    public function __construct(
+        string $Label,
+        string $Latitude,
+        string $Longitude,
+        int $Radius = ViewLocationBase::RADIUS_OMIT_VALUE
+    )
+    {
+        parent::__construct($Label, $Radius);
+
+        $this->latitude  = $Latitude;
+        $this->longitude = $Longitude;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        $return = [
+            'label' => $this->label,
+            'latitude' => $this->latitude,
+            'longitude' => $this->longitude,
+        ];
+
+        if($this->radius > ViewLocationBase::RADIUS_OMIT_VALUE){
+            $return['radius'] =$this->radius;
+        }
+
+        return (object)$return;
+    }
+}

+ 52 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/CardMessage.php

@@ -0,0 +1,52 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+/**
+ * Class CardMessage
+ * @package CMText\RichContent\Messages
+ */
+class CardMessage implements IRichMessage
+{
+
+    /**
+     * @var string Header text
+     */
+    private $header;
+
+    /**
+     * @var string Body text
+     */
+    private $text;
+
+    /**
+     * @var \CMText\RichContent\Messages\MediaContent
+     */
+    private $mediaContent;
+
+
+    /**
+     * CardMessage constructor.
+     * @param string $Text
+     * @param string $Header
+     * @param \CMText\RichContent\Messages\MediaContent $Media
+     */
+    public function __construct(string $Text, string $Header, MediaContent $Media)
+    {
+        $this->header = $Header;
+        $this->text   = $Text;
+        $this->mediaContent = $Media;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'header' => $this->header,
+            'text'   => $this->text,
+            'media'  => $this->mediaContent,
+        ];
+    }
+
+}

+ 22 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/CarouselCardWidth.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+/**
+ * Class CarouselCardWidth
+ * @package CMText\RichContent\Messages
+ */
+class CarouselCardWidth
+{
+
+    /**
+     * Value for Small card size
+     */
+    const SMALL = 'Small';
+
+    /**
+     * Value for Medium card size
+     */
+    const MEDIUM = 'Medium';
+
+}

+ 70 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/CarouselMessage.php

@@ -0,0 +1,70 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+/**
+ * Class CarouselMessage
+ * @package CMText\RichContent\Messages
+ */
+class CarouselMessage implements IRichMessage
+{
+
+    /**
+     * @var array List of Cards in carousel
+     */
+    private $cards;
+
+    /**
+     * @var string Size of Card in carousel as determined in \CMText\RichContent\CarouselCardWidth
+     */
+    private $cardWidth;
+
+
+    /**
+     * CarouselMessage constructor.
+     * @param string $CardWidth
+     * @param array $Cards
+     */
+    public function __construct(
+        string $CardWidth = CarouselCardWidth::MEDIUM,
+        array $Cards = []
+    )
+    {
+        self::SetCardWidth($CardWidth);
+
+        foreach ($Cards as $Card){
+            self::AddCard($Card);
+        }
+    }
+
+
+    /**
+     * Add one CardMessage to the carousel
+     * @param \CMText\RichContent\Messages\CardMessage $Card
+     */
+    public function AddCard(CardMessage $Card){
+        $this->cards[] = $Card;
+    }
+
+
+    /**
+     * Overwrite CardWidth setting
+     * @param string $CardWidth
+     */
+    public function SetCardWidth(string $CardWidth)
+    {
+        $this->cardWidth = $CardWidth;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'carousel' => (object)[
+                'cards'     => $this->cards,
+                'cardWidth' => $this->cardWidth,
+            ]
+        ];
+    }
+}

+ 47 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/ContactsMessage.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+use CMText\RichContent\Common\Contact;
+
+/**
+ * Class ContactsMessage
+ * @package CMText\RichContent\Messages
+ */
+class ContactsMessage implements IRichMessage
+{
+    /**
+     * @var \CMText\RichContent\Common\Contact[]
+     */
+    private $contacts = [];
+
+    /**
+     * ContactsMessage constructor.
+     * @param \CMText\RichContent\Common\Contact $Contact
+     */
+    public function __construct(Contact $Contact)
+    {
+        $this->addContact($Contact);
+    }
+
+    /**
+     * @param \CMText\RichContent\Common\Contact $Contact
+     */
+    public function addContact(Contact $Contact)
+    {
+        $this->contacts[] = $Contact;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'contacts' => array_filter($this->contacts),
+        ];
+    }
+}
+
+

+ 11 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/IRichMessage.php

@@ -0,0 +1,11 @@
+<?php
+namespace CMText\RichContent\Messages;
+
+/**
+ * Interface IRichMessage
+ * @package CMText\RichContent\Messages
+ */
+interface IRichMessage extends \JsonSerializable
+{
+
+}

+ 38 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/LocationPushMessage.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+use CMText\RichContent\Common\ViewLocationBase;
+
+/**
+ * Class LocationPushMessage
+ * @package CMText\RichContent\Messages
+ */
+class LocationPushMessage implements IRichMessage
+{
+    /**
+     * @var \CMText\RichContent\Common\ViewLocationBase Location to send.
+     */
+    private $location;
+
+
+    /**
+     * LocationPushMessage constructor.
+     * @param \CMText\RichContent\Common\ViewLocationBase $ViewLocation
+     */
+    public function __construct(ViewLocationBase $ViewLocation)
+    {
+        $this->location = $ViewLocation;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'location' => $this->location,
+        ];
+    }
+}

+ 55 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/MediaContent.php

@@ -0,0 +1,55 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+/**
+ * Class MediaContent
+ * @package CMText\RichContent\Messages
+ */
+class MediaContent implements \JsonSerializable
+{
+
+    /**
+     * @var string Display name of media
+     */
+    private $name;
+
+    /**
+     * @var string Uri for the media
+     */
+    private $uri;
+
+    /**
+     * @var string Mime-Type doe the media
+     */
+    private $mimetype;
+
+
+    /**
+     * MediaContent constructor.
+     * @param string $Name
+     * @param string $Uri
+     * @param string $Mimetype
+     */
+    public function __construct(
+        string $Name,
+        string $Uri,
+        string $Mimetype
+    )
+    {
+        $this->name = $Name;
+        $this->uri  = $Uri;
+        $this->mimetype = $Mimetype;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'mediaName' => $this->name,
+            'mediaUri'  => $this->uri,
+            'mimeType'  => $this->mimetype
+        ];
+    }
+}

+ 41 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/MediaMessage.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+/**
+ * Class MediaMessage
+ * @package CMText\RichContent\Messages
+ */
+class MediaMessage implements IRichMessage
+{
+
+    /**
+     * @var \CMText\RichContent\Messages\MediaContent
+     */
+    private $content;
+
+
+    /**
+     * MediaMessage constructor.
+     * @param string $Name
+     * @param string $Uri
+     * @param string $Mimetype
+     */
+    public function __construct(
+        string $Name,
+        string $Uri,
+        string $Mimetype
+    )
+    {
+        $this->content = new MediaContent($Name, $Uri, $Mimetype);
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'media' => $this->content,
+        ];
+    }
+}

+ 35 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/PaymentMessage.php

@@ -0,0 +1,35 @@
+<?php
+
+
+namespace CMText\RichContent\Messages;
+
+
+use CMText\RichContent\Payments\PaymentConfigurationBase;
+
+
+class PaymentMessage implements IRichMessage
+{
+    /**
+     * The PaymentConfiguration
+     * @var \CMText\RichContent\Payments\PaymentConfigurationBase
+     */
+    public $payment;
+
+    /**
+     * PaymentMessage constructor.
+     * @param \CMText\RichContent\Payments\PaymentConfigurationBase $PaymentConfiguration
+     */
+    public function __construct(PaymentConfigurationBase $PaymentConfiguration)
+    {
+        $this->payment = $PaymentConfiguration;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return $this;
+    }
+}

+ 27 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/TemplateMessage.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+use CMText\RichContent\Templates\TemplateContentBase;
+
+
+class TemplateMessage implements IRichMessage
+{
+
+    public $template;
+
+
+    public function __construct(TemplateContentBase $Template)
+    {
+        $this->template = $Template;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return $this;
+    }
+}

+ 44 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/TextMessage.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace CMText\RichContent\Messages;
+
+/**
+ * Class TextMessage
+ * @package CMText\RichContent\Messages
+ */
+class TextMessage implements IRichMessage
+{
+
+    /**
+     * @var string Body text of the message
+     */
+    protected $text;
+
+
+    /**
+     * @var string Instagram message tag (optional)
+     */
+    protected $tag;
+
+
+    /**
+     * TextMessage constructor.
+     * @param string $Text
+     * @param string $Tag
+     */
+    public function __construct(string $Text, string $Tag = '')
+    {
+        $this->text = $Text;
+        $this->tag = $Tag;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)array_filter([
+            'text' => $this->text,
+            'tag' => $this->tag
+        ]);
+    }
+}

+ 8 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/IWhatsAppInteractiveAction.php

@@ -0,0 +1,8 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+interface IWhatsAppInteractiveAction
+{
+
+}

+ 15 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveBody.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+class WhatsAppInteractiveBody
+{
+    public $text;
+
+    public function __construct(
+        string $text
+    )
+    {
+        $this->text = $text;
+    }
+}

+ 24 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveButtonAction.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+class WhatsAppInteractiveButtonAction implements IWhatsAppInteractiveAction
+{
+    public $buttons;
+
+    /**
+     * @param array $buttons
+     * @throws \Exception
+     */
+    public function __construct(
+        array $buttons
+    )
+    {
+        foreach ($buttons as $b){
+            if(!is_subclass_of($b, WhatsAppInteractiveButtonBase::class)){
+                throw new \Exception("Button is not derived from WhatsAppInteractiveButtonBase.");
+            }
+        }
+        $this->buttons = $buttons;
+    }
+}

+ 13 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveButtonBase.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+abstract class WhatsAppInteractiveButtonBase
+{
+    public $type;
+
+    public function __construct(string $type)
+    {
+        $this->type = $type;
+    }
+}

+ 8 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveButtonTypes.php

@@ -0,0 +1,8 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+class WhatsAppInteractiveButtonTypes
+{
+    const REPLY = 'reply';
+}

+ 74 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveContent.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+
+class WhatsAppInteractiveContent implements \JsonSerializable
+{
+    public $type;
+
+    public $header;
+
+    public $body;
+
+    public $footer;
+
+    public $action;
+
+    /**
+     * @param string $type
+     * @param WhatsAppInteractiveHeader|null $header
+     * @param WhatsAppInteractiveBody|null $body
+     * @param IWhatsAppInteractiveAction|null $action
+     * @param WhatsAppInteractiveFooter|null $footer
+     * @throws \Exception
+     */
+    public function __construct(
+        string $type,
+        WhatsAppInteractiveHeader $header = null,
+        WhatsAppInteractiveBody $body = null,
+        IWhatsAppInteractiveAction $action = null,
+        WhatsAppInteractiveFooter $footer = null
+    )
+    {
+        if( !in_array(
+            $type,
+            (new \ReflectionClass(WhatsAppInteractiveContentTypes::class))->getConstants())
+        ){
+            throw new \Exception("Unsupport WhatsApp-InteractiveContent-type $type");
+        }
+
+        //  action is always required.
+        if($action == null){
+            throw new \Exception("Action is always Required.");
+        }
+
+        //  header is required for type Product-list
+        if($type == WhatsAppInteractiveContentTypes::PRODUCT_LIST && $header == null){
+            throw new \Exception("Header is required for type $type");
+        }
+
+        //  body is optional for type Product, otherwise required.
+        if($type != WhatsAppInteractiveContentTypes::PRODUCT && $body == null){
+            throw new \Exception("Body is Required for $type");
+        }
+
+        $this->type = $type;
+        $this->header = $header;
+        $this->body = $body;
+        $this->footer = $footer;
+        $this->action = $action;
+    }
+
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)array_filter([
+            'type' => $this->type,
+            'header' => $this->header,
+            'body' => $this->body,
+            'footer' => $this->footer,
+            'action' => $this->action
+        ]);
+    }
+}

+ 11 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveContentTypes.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+class WhatsAppInteractiveContentTypes
+{
+    const LIST = 'list';
+    const BUTTON = 'button';
+    const PRODUCT = 'product';
+    const PRODUCT_LIST = 'product_list';
+}

+ 18 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveFooter.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+class WhatsAppInteractiveFooter
+{
+    public $text;
+
+    /**
+     * @param string $text
+     */
+    public function __construct(
+        string $text
+    )
+    {
+        $this->text = $text;
+    }
+}

+ 34 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveHeader.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+use CMText\RichContent\Messages\MediaContent;
+
+class WhatsAppInteractiveHeader
+{
+    public $type;
+
+    public $text;
+
+    public $media;
+
+    /**
+     * @param string $type
+     * @param string $text
+     * @param MediaContent|null $media
+     * @throws \Exception
+     */
+    public function __construct(
+        string $type,
+        string $text = null,
+        MediaContent $media = null)
+    {
+        if( !in_array($type, (new \ReflectionClass(WhatsAppInteractiveHeaderTypes::class))->getConstants()) ){
+            throw new \Exception("Unsupported WhatsApp-InteractiveHeader-type $type");
+        }
+
+        $this->type = $type;
+        $this->text = !$text ? null : $text;
+        $this->media = $media;
+    }
+}

+ 11 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveHeaderTypes.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+class WhatsAppInteractiveHeaderTypes
+{
+    const DOCUMENT = 'document';
+    const IMAGE = 'image';
+    const TEXT = 'text';
+    const VIDEO = 'video';
+}

+ 30 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveListAction.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+class WhatsAppInteractiveListAction implements IWhatsAppInteractiveAction
+{
+    public $button;
+
+    public $sections;
+
+    /**
+     * @param string $button
+     * @param array $sections
+     * @throws \Exception
+     */
+    public function __construct(
+        string $button,
+        array $sections
+    )
+    {
+        $this->button = $button;
+
+        foreach ($sections??[] as $section){
+            if(get_class($section) != WhatsAppInteractiveSection::class){
+                throw new \Exception("Section is not a WhatsAppInteractiveSection.");
+            }
+        }
+        $this->sections = $sections;
+    }
+}

+ 29 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveMessage.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+use CMText\RichContent\Messages\IRichMessage;
+
+class WhatsAppInteractiveMessage implements IRichMessage
+{
+    /**
+     * @var WhatsAppInteractiveContent
+     */
+    public $interactive;
+
+    /**
+     * @param WhatsAppInteractiveContent $content
+     */
+    public function __construct(
+        WhatsAppInteractiveContent $content
+    )
+    {
+        $this->interactive = $content;
+    }
+
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return $this;
+    }
+}

+ 21 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveReplyButton.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+class WhatsAppInteractiveReplyButton extends WhatsAppInteractiveButtonBase
+{
+    public $reply;
+
+    public function __construct(
+        string $title,
+        string $id
+    )
+    {
+        parent::__construct(WhatsAppInteractiveButtonTypes::REPLY);
+
+        $this->reply = (object)[
+            'id' => $id,
+            'title' => $title
+        ];
+    }
+}

+ 32 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveSection.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+
+class WhatsAppInteractiveSection
+{
+    public $title;
+
+    public $rows;
+
+    /**
+     * @param string $title
+     * @param array $rows
+     * @throws \Exception
+     */
+    public function __construct(
+        string $title,
+        array $rows
+    )
+    {
+        $this->title = $title;
+
+        foreach ($rows as $row){
+            if(get_class($row) != WhatsAppInteractiveSectionRow::class){
+                throw new \Exception("Unsupported Row-type : " . get_class($row));
+            }
+        }
+
+        $this->rows = $rows;
+    }
+}

+ 29 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Messages/WhatsApp/WhatsAppInteractiveSectionRow.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace CMText\RichContent\Messages\WhatsApp;
+
+
+class WhatsAppInteractiveSectionRow
+{
+    public $title;
+
+    public $id;
+
+    public $description;
+
+    /**
+     * @param string $title
+     * @param string $id
+     * @param string|null $description
+     */
+    public function __construct(
+        string $title,
+        string $id,
+        string $description = null
+    )
+    {
+        $this->title = $title;
+        $this->id = $id;
+        $this->description = $description;
+    }
+}

+ 117 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Payments/ApplePayConfiguration.php

@@ -0,0 +1,117 @@
+<?php
+
+
+namespace CMText\RichContent\Payments;
+
+
+class ApplePayConfiguration extends PaymentConfigurationBase
+{
+    /**
+     * (Required) A unique identifier that represents a merchant for Apple Pay.
+     * @var string
+     */
+    public $merchantName;
+
+    /**
+     * (Required) Description of the item being bought.
+     * @var string
+     */
+    public $description;
+
+    /**
+     * (Required) A unique identifier that represents a order
+     * @var $string
+     */
+    public $orderReference;
+
+    /**
+     * @inheritdoc
+     */
+    public $lineItems;
+
+    /**
+     * A dictionary containing the total.
+     * @var float
+     */
+    public $total;
+
+    /**
+     * Email address of the Apple Pay contact.
+     * @var string
+     */
+    public $recipientEmail;
+
+    /**
+     * Value indicating the currency code of the apple pay request
+     * @var string
+     */
+    public $currencyCode;
+
+    /**
+     * Country of the Apple Pay contact.
+     * @var string
+     */
+    public $recipientCountryCode;
+
+    /**
+     * The Language of the Country of the Apple Pay Contact
+     * @var string
+     */
+    public $languageCountryCode;
+
+    /**
+     * Value indicating that a billing address is required
+     * @var boolean
+     */
+    public $billingAddressRequired;
+
+    /**
+     * Value indicating that a shipping contact is required
+     * @var boolean
+     */
+    public $shippingContactRequired;
+
+    /**
+     * ApplePayConfiguration constructor.
+     * @param string $merchantName
+     * @param string $description
+     * @param string $orderReference
+     * @param float $total
+     * @param string $currencyCode
+     * @param string $recipientEmail
+     * @param string $recipientCountryCode
+     * @param string $languageCountryCode
+     * @param bool $billingAddressRequired
+     * @param bool $shippingContactRequired
+     * @param array $lineItems
+     */
+    public function __construct(
+        string $merchantName,
+        string $description,
+        string $orderReference,
+        float $total,
+        string $currencyCode,
+        string $recipientEmail,
+        string $recipientCountryCode,
+        string $languageCountryCode,
+        bool $billingAddressRequired,
+        bool $shippingContactRequired,
+        array $lineItems
+    )
+    {
+        $this->merchantName = $merchantName;
+        $this->description = $description;
+        $this->orderReference = $orderReference;
+        $this->total = $total;
+        $this->currencyCode = $currencyCode;
+        $this->recipientEmail = $recipientEmail;
+        $this->recipientCountryCode = $recipientCountryCode;
+        $this->languageCountryCode = $languageCountryCode;
+        $this->billingAddressRequired = $billingAddressRequired;
+        $this->shippingContactRequired = $shippingContactRequired;
+
+        foreach ($lineItems as $lineItem) {
+            $this->addLineItem($lineItem);
+        }
+    }
+}

+ 35 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Payments/PaymentConfigurationBase.php

@@ -0,0 +1,35 @@
+<?php
+
+
+namespace CMText\RichContent\Payments;
+
+
+use CMText\RichContent\Common\LineItem;
+use JsonSerializable;
+
+abstract class PaymentConfigurationBase implements JsonSerializable
+{
+    /**
+     * An array of line items explaining payments and additional charges.
+     * @var \CMText\RichContent\Common\LineItem[]
+     */
+    public $lineItems;
+
+    /**
+     * Add a LineItem to the PaymentConfiguration
+     * @param \CMText\RichContent\Common\LineItem $lineItem
+     */
+    public function addLineItem(LineItem $lineItem)
+    {
+        $this->lineItems[] = $lineItem;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return $this;
+    }
+}

+ 79 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/RichContent.php

@@ -0,0 +1,79 @@
+<?php
+namespace CMText\RichContent;
+
+
+use CMText\Exceptions\ConversationLimitException;
+use CMText\Exceptions\SuggestionsLimitException;
+use CMText\RichContent\Messages\IRichMessage;
+use CMText\RichContent\Suggestions\ISuggestion;
+
+/**
+ * Class RichContent
+ * @package CMText\RichContent
+ */
+class RichContent implements \JsonSerializable
+{
+
+    /**
+     * @var array List of Conversation parts
+     */
+    private $conversation = [];
+
+    /**
+     * @var array List of Suggestion parts
+     */
+    private $suggestions = [];
+
+    /**
+     * Maximum amount of allowed Conversation parts
+     */
+    const CONVERSATION_LENGTH_LIMIT = 5;
+
+    /**
+     * Maximum amount of allowed Suggestion parts
+     */
+    const SUGGESTIONS_LENGTH_LIMIT = 11;
+
+
+    /**
+     * Add a RichMessage to the Conversation
+     * @param \CMText\RichContent\Messages\IRichMessage $richMessage
+     * @throws \CMText\Exceptions\ConversationLimitException
+     */
+    public function AddConversationPart(IRichMessage $richMessage)
+    {
+        $this->conversation[] = $richMessage;
+
+        if(count($this->conversation) > self::CONVERSATION_LENGTH_LIMIT){
+            throw new ConversationLimitException();
+        }
+    }
+
+
+    /**
+     * Add a Suggestion to the list of suggestions
+     * @param \CMText\RichContent\Suggestions\ISuggestion $suggestion
+     * @throws \CMText\Exceptions\SuggestionsLimitException
+     */
+    public function AddSuggestion(ISuggestion $suggestion)
+    {
+        $this->suggestions[] = $suggestion;
+
+        if(count($this->suggestions) > self::SUGGESTIONS_LENGTH_LIMIT){
+            throw new SuggestionsLimitException();
+        }
+    }
+
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)array_filter([
+            'conversation' => $this->conversation,
+            'suggestions'  => $this->suggestions
+        ]);
+    }
+}

+ 65 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/CalendarOptions.php

@@ -0,0 +1,65 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+/**
+ * Class CalendarOptions
+ * @package CMText\RichContent\Suggestions
+ */
+class CalendarOptions implements \JsonSerializable
+{
+
+    /**
+     * @var \DateTimeInterface Beginning of event
+     */
+    private $start;
+
+    /**
+     * @var \DateTimeInterface End of event
+     */
+    private $end;
+
+    /**
+     * @var string Title of the event
+     */
+    private $title;
+
+    /**
+     * @var string Description of the event
+     */
+    private $description;
+
+
+    /**
+     * CalendarOptions constructor.
+     * @param \DateTimeInterface $Start
+     * @param \DateTimeInterface $End
+     * @param string $Title
+     * @param string $Description
+     */
+    public function __construct(
+        \DateTimeInterface $Start,
+        \DateTimeInterface $End,
+        string $Title,
+        string $Description
+    )
+    {
+        $this->start = $Start->format(DATE_ATOM);
+        $this->end   = $End->format(DATE_ATOM);
+
+        $this->title = $Title;
+        $this->description = $Description;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'startTime' => $this->start,
+            'endTime' => $this->end,
+            'title' => $this->title,
+            'description' => $this->description,
+        ];
+    }
+}

+ 48 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/CalendarSuggestion.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+/**
+ * Class CalendarSuggestion
+ * @package CMText\RichContent\Suggestions
+ */
+class CalendarSuggestion extends SuggestionBase
+{
+
+    /**
+     * @var string action command
+     */
+    protected $action = 'CreateCalendarEvent';
+
+    /**
+     * @var \CMText\RichContent\Suggestions\CalendarOptions
+     */
+    private $calendarOptions;
+
+
+    /**
+     * CalendarSuggestion constructor.
+     * @param string $Label
+     * @param \CMText\RichContent\Suggestions\CalendarOptions $CalendarOptions
+     */
+    public function __construct(
+        string $Label,
+        CalendarOptions $CalendarOptions
+    )
+    {
+        $this->label = $Label;
+
+        $this->calendarOptions = $CalendarOptions;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'action' => $this->action,
+            'label'  => $this->label,
+            'calendar' => $this->calendarOptions,
+        ];
+    }
+}

+ 35 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/DialOptions.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+/**
+ * Class DialOptions
+ * @package CMText\RichContent\Suggestions
+ */
+class DialOptions implements \JsonSerializable
+{
+
+    /**
+     * @var string Phonenumber in International format (ie. +334455667788)
+     */
+    private $phonenumber;
+
+
+    /**
+     * DialOptions constructor.
+     * @param string $phonenumber
+     */
+    public function __construct(string $phonenumber)
+    {
+        $this->phonenumber = $phonenumber;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'PhoneNumber' => $this->phonenumber,
+        ];
+    }
+}

+ 48 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/DialSuggestion.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+/**
+ * Class DialSuggestion
+ * @package CMText\RichContent\Suggestions
+ */
+class DialSuggestion extends SuggestionBase
+{
+
+    /**
+     * @var string Action command
+     */
+    protected $action = 'Dial';
+
+    /**
+     * @var \CMText\RichContent\Suggestions\DialOptions
+     */
+    protected $dial;
+
+
+    /**
+     * DialSuggestion constructor.
+     * @param string $Label
+     * @param string $Phonenumber
+     */
+    public function __construct(
+        string $Label,
+        string $Phonenumber
+    )
+    {
+        $this->label = $Label;
+        $this->dial  = new DialOptions($Phonenumber);
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'action' => $this->action,
+            'label'  => $this->label,
+            'dial'   => $this->dial,
+        ];
+    }
+
+}

+ 12 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/ISuggestion.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+/**
+ * Interface ISuggestion
+ * @package CMText\RichContent\Suggestions
+ */
+interface ISuggestion extends \JsonSerializable
+{
+
+}

+ 47 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/OpenUrlSuggestion.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+/**
+ * Class OpenUrlSuggestion
+ * @package CMText\RichContent\Suggestions
+ */
+class OpenUrlSuggestion extends SuggestionBase
+{
+
+    /**
+     * @var string Action command
+     */
+    protected $action = 'OpenUrl';
+
+    /**
+     * @var string Url to point to
+     */
+    private $url;
+
+
+    /**
+     * OpenUrlSuggestion constructor.
+     * @param string $Label
+     * @param string $Url
+     */
+    public function __construct(
+        string $Label,
+        string $Url
+    )
+    {
+        $this->label = $Label;
+        $this->url   = $Url;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'action' => $this->action,
+            'label' => $this->label,
+            'url' => $this->url,
+        ];
+    }
+}

+ 43 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/ReplySuggestion.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+/**
+ * Class ReplySuggestion
+ * @package CMText\RichContent\Suggestions
+ */
+class ReplySuggestion extends SuggestionBase
+{
+
+    /**
+     * @var string Action command
+     */
+    protected $action = 'Reply';
+
+    /**
+     * @var string When set, this will be used as reply-text instead of Label
+     */
+    protected $text;
+
+
+    public function __construct(
+        string $Label,
+        string $Text = null
+    )
+    {
+        $this->label = $Label;
+        $this->text  = $Text;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)array_filter([
+            'action' => $this->action,
+            'label' => $this->label,
+            'postbackdata' => $this->text,
+        ]);
+    }
+
+}

+ 25 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/SuggestionBase.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+/**
+ * Class SuggestionBase
+ * @package CMText\RichContent\Suggestions
+ */
+abstract class SuggestionBase implements ISuggestion
+{
+
+    /**
+     * @var string Action command for a Suggestion.
+     */
+    protected $action;
+
+    /**
+     * @var string Text the end user will see.
+     */
+    protected $label;
+
+
+	#[\ReturnTypeWillChange]
+    abstract public function jsonSerialize();
+}

+ 50 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Suggestions/ViewLocationSuggestion.php

@@ -0,0 +1,50 @@
+<?php
+
+namespace CMText\RichContent\Suggestions;
+
+use CMText\RichContent\Common\ViewLocationBase;
+
+/**
+ * Class ViewLocationSuggestion
+ * @package CMText\RichContent\Suggestions
+ */
+class ViewLocationSuggestion extends SuggestionBase
+{
+
+    /**
+     * @var string Action command
+     */
+    protected $action = 'viewLocation';
+
+    /**
+     * @var ViewLocationBase
+     */
+    private $viewLocation;
+
+
+    /**
+     * ViewLocationSuggestion constructor.
+     * @param string $Label
+     * @param ViewLocationBase $ViewLocation
+     */
+    public function __construct(
+        string $Label,
+        ViewLocationBase $ViewLocation
+    )
+    {
+        $this->label = $Label;
+        $this->viewLocation = $ViewLocation;
+    }
+
+
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'action' => $this->action,
+            'label' => $this->label,
+            'viewLocation' => $this->viewLocation,
+        ];
+    }
+
+}

+ 13 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/ITemplateContent.php

@@ -0,0 +1,13 @@
+<?php
+
+
+namespace CMText\RichContent\Templates;
+
+
+use CMText\RichContent\Messages\IRichMessage;
+
+
+interface ITemplateContent extends IRichMessage
+{
+
+}

+ 32 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/TemplateContentBase.php

@@ -0,0 +1,32 @@
+<?php
+
+
+namespace CMText\RichContent\Templates;
+
+
+abstract class TemplateContentBase implements ITemplateContent
+{
+
+    /**
+     * Template key
+     */
+    const TEMPLATE_KEY = '';
+
+    /**
+     * the Content Object with the actual template properties.
+     * @var $content object
+     */
+    protected $content;
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    function jsonSerialize()
+    {
+        return (object)[
+            static::TEMPLATE_KEY => $this->content
+        ];
+    }
+
+}

+ 88 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentBase.php

@@ -0,0 +1,88 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\Exceptions\WhatsappTemplateComponentParameterTypeException;
+
+
+abstract class ComponentBase implements \JsonSerializable
+{
+    /**
+     * The Type of the Component
+     * @const
+     */
+    const TYPE = self::class;
+
+    /**
+     * To expose the Component type
+     * @var string
+     */
+    public $type;
+
+    /**
+     * To expose the Component Parameters
+     * @var array $parameters
+     */
+    public $parameters = [];
+
+    /**
+     * The ComponentParameter-types supported by this Component
+     * @var array $supportedParameterTypes
+     */
+    protected $supportedParameterTypes = [];
+
+    /**
+     * ComponentBase constructor.
+     * @param string $type
+     * @param array $parameters
+     * @throws WhatsappTemplateComponentParameterTypeException
+     */
+    public function __construct(
+        string $type,
+        array $parameters = []
+    )
+    {
+        $this->type = $type;
+
+        foreach ($parameters as $parameter){
+            $this->addParameter($parameter);
+        }
+    }
+
+    /**
+     * Add one ComponentParameter to the current set of ComponentParameters
+     * @param ComponentParameterBase $parameter
+     * @throws WhatsappTemplateComponentParameterTypeException
+     */
+    public function addParameter(ComponentParameterBase $parameter)
+    {
+        if ($this->supportsParameterType($parameter)) {
+            $this->parameters[] = $parameter;
+        }
+    }
+
+    /**
+     * Checks if the given ComponentParameter is supported by the Component
+     * @param ComponentParameterBase $parameter
+     * @return bool
+     * @throws WhatsappTemplateComponentParameterTypeException
+     */
+    private function supportsParameterType(ComponentParameterBase $parameter)
+    {
+        if (in_array($parameter->type, $this->supportedParameterTypes)) {
+            return true;
+        } else {
+            throw new WhatsappTemplateComponentParameterTypeException('Parameter-type '. $parameter->type .' not supported in Component-type '. $this->type);
+        }
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return $this;
+    }
+}

+ 34 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentBody.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\Exceptions\WhatsappTemplateComponentParameterTypeException;
+
+
+class ComponentBody extends ComponentBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'body';
+
+    /**
+     * @inheritdoc
+     */
+    protected $supportedParameterTypes = [
+        ComponentParameterCurrency::TYPE,
+        ComponentParameterDatetime::TYPE,
+        ComponentParameterText::TYPE,
+    ];
+
+    /**
+     * ComponentBody constructor.
+     * @param array $parameters
+     * @throws WhatsappTemplateComponentParameterTypeException
+     */
+    public function __construct(array $parameters = [])
+    {
+        parent::__construct(self::TYPE, $parameters);
+    }
+}

+ 45 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentButton.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\Exceptions\WhatsappTemplateComponentParameterTypeException;
+
+
+class ComponentButton extends ComponentBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'button';
+
+    /**
+     * The zero-based index of the Button to set the order in case of several Buttons
+     * @var int $index
+     */
+    public $index;
+
+    /**
+     * @inheritdoc
+     */
+    protected $supportedParameterTypes = [
+        ComponentParameterText::TYPE,
+        ComponentParameterPayload::TYPE,
+    ];
+
+    /**
+     * ComponentButton constructor.
+     * @param int $index
+     * @param ComponentParameterBase $parameter
+     * @throws WhatsappTemplateComponentParameterTypeException
+     */
+    public function __construct(int $index, ComponentParameterBase $parameter)
+    {
+        parent::__construct(
+            self::TYPE,
+            [$parameter]
+        );
+
+        $this->index = $index;
+    }
+}

+ 31 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentButtonQuickReply.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+class ComponentButtonQuickReply extends ComponentButton
+{
+    /**
+     * The sub-type of the ButtonComponent
+     * @var string $sub_type
+     */
+    public $sub_type = 'quick_reply';
+
+    /**
+     * @inheritdoc
+     */
+    protected $supportedParameterTypes = [
+        ComponentParameterPayload::TYPE,
+    ];
+
+    /**
+     * ComponentButtonQuickReply constructor.
+     * @param int $index
+     * @param ComponentParameterPayload $parameter
+     * @throws \CMText\Exceptions\WhatsappTemplateComponentParameterTypeException
+     */
+    public function __construct(int $index, ComponentParameterPayload $parameter)
+    {
+        parent::__construct($index, $parameter);
+    }
+}

+ 31 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentButtonUrl.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+class ComponentButtonUrl extends ComponentButton
+{
+    /**
+     * The sub-type of the ButtonComponent
+     * @var string $sub_type
+     */
+    public $sub_type = 'url';
+
+    /**
+     * @inheritdoc
+     */
+    protected $supportedParameterTypes = [
+        ComponentParameterText::TYPE,
+    ];
+
+    /**
+     * ComponentButtonUrl constructor.
+     * @param int $index
+     * @param ComponentParameterText $parameter
+     * @throws \CMText\Exceptions\WhatsappTemplateComponentParameterTypeException
+     */
+    public function __construct(int $index, ComponentParameterText $parameter)
+    {
+        parent::__construct($index, $parameter);
+    }
+}

+ 34 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentFooter.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\Exceptions\WhatsappTemplateComponentParameterTypeException;
+
+
+class ComponentFooter extends ComponentBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'footer';
+
+    /**
+     * @inheritdoc
+     */
+    protected $supportedParameterTypes = [
+        ComponentParameterCurrency::TYPE,
+        ComponentParameterDatetime::TYPE,
+        ComponentParameterText::TYPE,
+    ];
+
+    /**
+     * ComponentFooter constructor.
+     * @param array $parameters
+     * @throws WhatsappTemplateComponentParameterTypeException
+     */
+    public function __construct(array $parameters = [])
+    {
+        parent::__construct(self::TYPE, $parameters);
+    }
+}

+ 35 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentHeader.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\Exceptions\WhatsappTemplateComponentParameterTypeException;
+
+
+class ComponentHeader extends ComponentBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'header';
+
+    /**
+     * @inheritdoc
+     */
+    protected $supportedParameterTypes = [
+        ComponentParameterText::TYPE,
+        ComponentParameterImage::TYPE,
+        ComponentParameterDocument::TYPE,
+        ComponentParameterVideo::TYPE,
+    ];
+
+    /**
+     * ComponentHeader constructor.
+     * @param array $parameters
+     * @throws WhatsappTemplateComponentParameterTypeException
+     */
+    public function __construct(array $parameters = [])
+    {
+        parent::__construct(self::TYPE, $parameters);
+    }
+}

+ 38 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterBase.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+abstract class ComponentParameterBase implements \JsonSerializable
+{
+    /**
+     * The Type of the ComponentParameter
+     * @const
+     */
+    const TYPE = self::class;
+
+    /**
+     * To expose the ComponentParameter type
+     * @var string
+     */
+    public $type;
+
+    /**
+     * ComponentParameterBase constructor.
+     * @param string $type
+     */
+    public function __construct(string $type)
+    {
+        $this->type = $type;
+    }
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return $this;
+    }
+
+}

+ 42 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterCurrency.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use stdClass;
+
+
+class ComponentParameterCurrency extends ComponentParameterBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'currency';
+
+    /**
+     * The Currency object
+     * @var stdClass
+     */
+    public $currency;
+
+    /**
+     * ComponentParameterCurrency constructor.
+     * @param string $fallback_value The string to be used when currency formatting fails
+     * @param string $code The currency-code like EUR or USD
+     * @param float $amount_1000 The amount in currency-code times 1000 (20210 for $20.21)
+     */
+    public function __construct(
+        string $fallback_value,
+        string $code,
+        float $amount_1000
+    )
+    {
+        parent::__construct(self::TYPE);
+
+        $this->currency = new stdClass();
+        $this->currency->fallback_value = $fallback_value;
+        $this->currency->code = $code;
+        $this->currency->amount_1000 = $amount_1000;
+    }
+
+}

+ 40 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterDatetime.php

@@ -0,0 +1,40 @@
+<?php
+
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use DateTimeInterface;
+use stdClass;
+
+class ComponentParameterDatetime extends ComponentParameterBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'date_time';
+
+    /**
+     * The date_time object
+     * @var stdClass
+     */
+    public $date_time;
+
+    /**
+     * ComponentParameterDatetime constructor.
+     * @param string $fallback_value Fallback value in case formatting the DateTime object fails
+     * @param DateTimeInterface $datetime
+     */
+    public function __construct(
+        string $fallback_value,
+        DateTimeInterface $datetime
+    )
+    {
+        parent::__construct(self::TYPE);
+
+        $this->date_time = new stdClass;
+        $this->date_time->fallback_value = $fallback_value;
+        $this->date_time->timestamp = $datetime->getTimestamp();
+    }
+
+}

+ 32 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterDocument.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\RichContent\Messages\MediaContent;
+
+
+class ComponentParameterDocument extends ComponentParameterBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'document';
+
+    /**
+     * The MediaContent object describing the document
+     * @var MediaContent
+     */
+    public $media;
+
+    /**
+     * ComponentParameterDocument constructor.
+     * @param MediaContent $mediaContent
+     */
+    public function __construct(MediaContent $mediaContent)
+    {
+        parent::__construct(self::TYPE);
+
+        $this->media = $mediaContent;
+    }
+}

+ 32 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterImage.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\RichContent\Messages\MediaContent;
+
+
+class ComponentParameterImage extends ComponentParameterBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'image';
+
+    /**
+     * The MediaContent object describing the image
+     * @var MediaContent
+     */
+    public $media;
+
+    /**
+     * ComponentParameterImage constructor.
+     * @param MediaContent $mediaContent
+     */
+    public function __construct(MediaContent $mediaContent)
+    {
+        parent::__construct(self::TYPE);
+
+        $this->media = $mediaContent;
+    }
+}

+ 29 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterPayload.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+class ComponentParameterPayload extends ComponentParameterBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'payload';
+
+    /**
+     * The payload to expose
+     * @var string $payload
+     */
+    public $payload;
+
+    /**
+     * ComponentParameterPayload constructor.
+     * @param string $payload
+     */
+    public function __construct(string $payload)
+    {
+        parent::__construct(self::TYPE);
+
+        $this->payload = $payload;
+    }
+}

+ 30 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterText.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+class ComponentParameterText extends ComponentParameterBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'text';
+
+    /**
+     * The text to expose
+     * @var string
+     */
+    public $text;
+
+    /**
+     * ComponentParameterText constructor.
+     * @param string $text
+     */
+    public function __construct(string $text)
+    {
+        parent::__construct(self::TYPE);
+
+        $this->text = $text;
+    }
+
+}

+ 33 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/ComponentParameterVideo.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\RichContent\Messages\MediaContent;
+
+
+class ComponentParameterVideo extends ComponentParameterBase
+{
+    /**
+     * @inheritdoc
+     */
+    const TYPE = 'video';
+
+    /**
+     * The MediaContent object describing the video
+     * @var MediaContent
+     */
+    public $media;
+
+    /**
+     * ComponentParameterVideo constructor.
+     * @param MediaContent $mediaContent
+     */
+    public function __construct(MediaContent $mediaContent)
+    {
+        parent::__construct(self::TYPE);
+
+        $this->media = $mediaContent;
+    }
+
+}

+ 41 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/Language.php

@@ -0,0 +1,41 @@
+<?php
+
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+class Language implements \JsonSerializable
+{
+    /**
+     * @var string Language or Locale code , ie. en or en_US.
+     */
+    private $code = 'en';
+
+    /**
+     * @var string Language policy the message should follow.
+     */
+    private $policy = 'deterministic';
+
+
+    /**
+     * Language constructor.
+     * @param string $Code
+     */
+    public function __construct(string $Code)
+    {
+        $this->code = $Code;
+    }
+
+
+    /**
+     * @inheritDoc
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'code' => $this->code,
+            'policy' => $this->policy,
+        ];
+    }
+}

+ 52 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/RichContent/Templates/Whatsapp/WhatsappTemplate.php

@@ -0,0 +1,52 @@
+<?php
+
+
+namespace CMText\RichContent\Templates\Whatsapp;
+
+
+use CMText\RichContent\Templates\TemplateContentBase;
+
+class WhatsappTemplate extends TemplateContentBase
+{
+
+    /**
+     * The template-key for whatsapp templates
+     */
+    const TEMPLATE_KEY = 'whatsapp';
+
+
+    /**
+     * WhatsappTemplate constructor.
+     * @param string $Namespace
+     * @param string $ElementName
+     * @param Language $Language
+     * @param array $Components
+     */
+    public function __construct(
+        string $Namespace,
+        string $ElementName,
+        Language $Language,
+        array $Components = []
+    )
+    {
+        $this->content = new \stdClass();
+        $this->content->namespace = $Namespace;
+        $this->content->element_name = $ElementName;
+        $this->content->language = $Language;
+        $this->content->components = [];
+
+        $this->addComponents($Components);
+    }
+
+    /**
+     * Add Components to the Template.
+     * @param array $Components
+     */
+    public function addComponents(array $Components)
+    {
+        foreach ($Components as $component){
+            $this->content->components[] = $component;
+        }
+    }
+
+}

+ 137 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/TextClient.php

@@ -0,0 +1,137 @@
+<?php
+
+namespace CMText;
+
+
+use CMText\Exceptions\MessagesLimitException;
+use CMText\Exceptions\RecipientLimitException;
+
+/**
+ * Class TextClient
+ *
+ * @package CMText
+ */
+class TextClient implements ITextClient
+{
+
+    /**
+     * @var string
+     */
+    private $gateway;
+
+    /**
+     * @var
+     */
+    private $apiKey;
+
+    /**
+     * Maximum amount of Message objects allowed per request
+     */
+    const MESSAGES_MAXIMUM = 1000;
+
+    /**
+     * SDK Version constant
+     */
+    const VERSION = '2.2.1';
+
+
+    /**
+     * TextClient constructor.
+     *
+     * @param string $apiKey
+     * @param string $gateway optional
+     */
+    public function __construct(
+        string $apiKey,
+        $gateway = Gateways::GLOBAL
+    )
+    {
+        // load the CM API KEY for authentication against the gateway
+        $this->apiKey = $apiKey;
+
+        // set the Gateway to use
+        $this->gateway = $gateway;
+    }
+
+
+    /**
+     * Fast and easy method to instantly send one message.
+     *
+     * @param string $message - Message body to send
+     * @param string $from - Sender name
+     * @param array $to - Recipient phonenumbers
+     * @param string|null $reference optional
+     *
+     * @return TextClientResult
+     * @throws RecipientLimitException
+     * @throws MessagesLimitException
+     */
+    public function SendMessage(
+        string $message,
+        string $from,
+        array $to,
+        string $reference = null
+    )
+    {
+        // send it out instantly
+        return self::send([
+            new Message($message, $from, $to, $reference)
+        ]);
+    }
+
+
+    /**
+     * Send an array of Message objects.
+     *
+     * @param array $messages Array of Message objects
+     *
+     * @return TextClientResult
+     * @throws MessagesLimitException
+     */
+    public function send(
+        array $messages
+    )
+    {
+        if(count($messages) > self::MESSAGES_MAXIMUM){
+            throw new MessagesLimitException('Maximum amount of Message objects exceeded. ('. self::MESSAGES_MAXIMUM .')');
+        }
+
+        $requestModel = new TextClientRequest($this->apiKey, $messages);
+        $ch = curl_init($this->gateway);
+
+        try {
+            curl_setopt_array($ch, [
+                CURLOPT_CUSTOMREQUEST => 'POST',
+                CURLOPT_POSTFIELDS => json_encode($requestModel),
+                CURLOPT_RETURNTRANSFER => true,
+                CURLOPT_HTTPHEADER => [
+                    'Content-Type: application/json; charset=utf-8',
+                    'Content-Length: ' . strlen( json_encode($requestModel) ),
+                    'X-CM-SDK: ' . 'text-sdk-php-' . self::VERSION,
+                ],
+                CURLOPT_TIMEOUT => 20,
+                CURLOPT_CONNECTTIMEOUT => 5,
+            ]);
+
+            $response = curl_exec($ch);
+            $statuscode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
+
+            // curl errors will raise an exception
+            if( curl_error($ch) ){
+                throw new \Exception( curl_error($ch) );
+            }
+
+        }catch (\Exception $exception){
+            $response = json_encode(['details' => $exception->getMessage()]);
+            $statuscode = TextClientStatusCodes::UNKNOWN;
+
+        }finally{
+            curl_close($ch);
+        }
+
+        $return = new TextClientResult($statuscode, $response);
+
+        return $return;
+    }
+
+}

+ 61 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/TextClientRequest.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace CMText;
+
+
+use JsonSerializable;
+
+/**
+ * Class TextClientRequest
+ *
+ * @package CMText
+ */
+class TextClientRequest implements JsonSerializable
+{
+
+    /**
+     * Keeps the "api key"
+     *
+     * @var string
+     */
+    private $producttoken;
+
+    /**
+     * Keeps the array of Message objects that will be sent
+     *
+     * @var array
+     */
+    private $messages;
+
+
+    /**
+     * TextClientRequest constructor.
+     *
+     * @param string $apiKey
+     * @param array  $messages
+     */
+    public function __construct(string $apiKey, array $messages)
+    {
+        $this->producttoken = $apiKey;
+
+        $this->messages = $messages;
+    }
+
+    /**
+     * @return object
+     */
+	#[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+        return (object)[
+            'messages' => (object)[
+
+                'authentication' => (object)[
+                    'producttoken' => $this->producttoken,
+                ],
+
+                'msg' => $this->messages
+            ]
+        ];
+    }
+}

+ 74 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/TextClientResult.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace CMText;
+
+
+/**
+ * Class TextClientResult
+ *
+ * @package CMText
+ */
+class TextClientResult
+{
+
+    /**
+     * @var int
+     */
+    private $httpStatusCode;
+
+    /**
+     * @var string
+     */
+    private $response;
+
+
+    /**
+     * TextClientResult constructor.
+     *
+     * @param int    $httpStatusCode
+     * @param string $responseBody
+     */
+    public function __construct(int $httpStatusCode, $responseBody = '')
+    {
+        $this->httpStatusCode = $httpStatusCode;
+        $this->response = $responseBody;
+
+        $this->processResponse();
+    }
+
+
+    /**
+     * Processes the Response from the gateway into a TextClientResult model.
+     */
+    private function processResponse()
+    {
+        // decode the response
+        $json = json_decode($this->response, false, 5);
+
+        if(null === $json){
+            $this->statusMessage = strlen($this->response) ? substr($this->response, 0, 100) : 'An error occurred';
+            $this->statusCode    = TextClientStatusCodes::UNKNOWN;
+
+        }else{
+            $this->statusMessage = $json->details   ?? 'An error occurred';
+            $this->statusCode    = $json->errorCode ?? TextClientStatusCodes::UNKNOWN;
+            $this->details       = $json->messages  ?? [];
+        }
+    }
+
+
+    /**
+     * @var string
+     */
+    public $statusMessage = '';
+
+    /**
+     * @var int
+     */
+    public $statusCode = 0;
+
+    /**
+     * @var array
+     */
+    public $details = [];
+}

+ 99 - 0
vendor/cmdotcom/text-sdk-php/src/CMText/TextClientStatusCodes.php

@@ -0,0 +1,99 @@
+<?php
+
+namespace CMText;
+
+
+/**
+ * Class TextClientStatusCodes
+ *
+ * Translations for the errorCode property from the gateway response body.
+ *
+ * @package CMText
+ */
+class TextClientStatusCodes
+{
+    /**
+     * All is well.
+     */
+    const OK = 0;
+
+    /**
+     * Authentication of the request failed.
+     */
+    const AUTHENTICATION_FAILED = 101;
+
+    /**
+     * The account using this authentication has insufficient balance.
+     */
+    const BALANCE_INSUFFICIENT = 102;
+
+    /**
+     * The product token is incorrect.
+     */
+    const APIKEY_INCORRECT = 103;
+
+    /**
+     * This request has one or more errors in its messages. Some or all messages have not been sent. See MSGs for details.
+     */
+    const REQUEST_NOT_ALL_SENT = 201;
+
+    /**
+     * This request is malformed, please confirm the JSON and that the correct data types are used.
+     */
+    const REQUEST_MALFORMED = 202;
+
+    /**
+     * The request's MSG array is incorrect.
+     */
+    const MSG_ARRAY_INCORRECT = 203;
+
+    /**
+     * This MSG has an invalid From field (per msg).
+     */
+    const MSG_INVALID_FROM = 301;
+
+    /**
+     * This MSG has an invalid To field (per msg).
+     */
+    const MSG_INVALID_TO = 302;
+
+    /**
+     * This MSG has an invalid MSISDN in the To field (per msg).
+     */
+    const MSG_INVALID_MSISDN = 303;
+
+    /**
+     * This MSG has an invalid Body field (per msg).
+     */
+    const MSG_INVALID_BODY = 304;
+
+    /**
+     * This MSG has an invalid field. Please confirm with the documentation (per msg).
+     */
+    const MSG_INVALID_FIELD = 305;
+
+    /**
+     * Message has been spam filtered.
+     */
+    const SPAM = 401;
+
+    /**
+     * Message has been blacklisted.
+     */
+    const BLACKLISTED = 402;
+
+    /**
+     * Message has been rejected.
+     */
+    const REJECTED = 403;
+
+    /**
+     * An internal error has occurred.
+     */
+    const INTERNAL_ERROR = 500;
+
+    /**
+     * Unknown error, please contact CM support.
+     */
+    const UNKNOWN = 999;
+}

Some files were not shown because too many files changed in this diff