PHP code example of supermeteor / sdk-php
1. Go to this page and download the library: Download supermeteor/sdk-php library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
supermeteor / sdk-php example snippets
use Supermeteor\Client;
$sm = new Supermeteor('<secret_key>');
$result = $sm->SendMessage('<type>', '+XXXXXXXXX', 'your message');
$result = $sm->sendEmail('[email protected] ', 'subject', 'your message');
$fromPhone = '+852 6444 4444'
$toPhone = '+852 6888 8888'
$result = $sm->sendWhatsapp($fromPhone, $toPhone, 'your message');
$supermeteor->sendWhatsapp($fromPhone, $toPhone, 'free text blah blah blah...');
$template = new \Supermeteor\WhatsappTemplateMessage(
'booking_confirmation',
'en',
['John', '2019-01-12']
);
// send a whatsapp template message
$supermeteor->sendWhatsapp($fromPhone, $toPhone, $template);
bash
composer
json
{
"fromPhone": "+852 6111 2222",
"secret": "{{secret}}",
"phone": "+852 6333 4444",
"template": {
"name": "call_back",
"language": {
"policy": "deterministic",
"code": "en"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Krishna"
},
{
"type": "text",
"text": "2022-06-11 10:00"
}
]
}
]
}
}