|
@@ -220,7 +220,7 @@ class Demo extends Api
|
|
|
return $error;
|
|
|
}
|
|
|
|
|
|
- public function whatsapp(){
|
|
|
+ public function whatsapp_cm(){
|
|
|
$account_id = '657a5348-b28f-4736-8c76-6c47f4b20e4e';
|
|
|
$daibi = '350448a7-e8bc-4310-8d5b-db3518a5d05e';
|
|
|
$url = 'https://gw.cmtelecom.com/v1.0/message';
|
|
@@ -232,5 +232,73 @@ class Demo extends Api
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ public function whatapp(){
|
|
|
+ //临时token
|
|
|
+ $token = 'EAAGE5ozNog8BO7w7y3JIh0AAQyiNmrByyekHPw5ZBITHas5rBPH0S2WdPKwZChiq3CLUNRI6MqmkpsN5wE53o4eJ7hyMdn6PAauOh7MMzDMuoZAICgafTo5yLRkC8DEGQs5iZBjzfvSnyFQ3n9Q4BEXeF2Y9nfGsysZC8n4IWqTEURSilc0w4k3aAQTJOtusbJuXDTpZAJSC9UspNTIi3UsipqtDWFbOuiJzIZD';
|
|
|
+
|
|
|
+ //发送者
|
|
|
+ $mobile_id = '279740441892291'; //test number :+1 555 609 4631, business_id: 306946452494181
|
|
|
+ //$mobile_id = '308176785712131'; //Elin Dance Stuido:+65 8879 9689 , business_id: 309484315581636
|
|
|
+
|
|
|
+ //没用的东西
|
|
|
+ $config_id = '321757761015767';
|
|
|
+
|
|
|
+ //接收者
|
|
|
+ $receive_mobile = '65' . '88799689';
|
|
|
+ //$receive_mobile = '86' . '15866999421';
|
|
|
+
|
|
|
+ //发送
|
|
|
+ $url = 'https://graph.facebook.com/v19.0/'.$mobile_id.'/messages';
|
|
|
+ $header = [
|
|
|
+ 'Authorization: Bearer ' . $token,
|
|
|
+ 'Content-Type: application/json',
|
|
|
+ ];
|
|
|
+ $body = [
|
|
|
+ 'messaging_product' => 'whatsapp',
|
|
|
+ 'recipient_type' => 'individual',
|
|
|
+ 'to' => $receive_mobile,
|
|
|
+ 'type' => 'template',
|
|
|
+ 'template' => [
|
|
|
+ 'name' => 'the_class_will_start_tomorrow',
|
|
|
+ 'language' => [
|
|
|
+ // 'code' => 'zh_CN',
|
|
|
+ 'code' => 'en_US'
|
|
|
+ ],
|
|
|
+ 'components' => [
|
|
|
+ [
|
|
|
+ 'type' => 'body',
|
|
|
+ 'parameters' => [
|
|
|
+ [
|
|
|
+ 'type' => 'text',
|
|
|
+ 'text' => '张三',
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'type' => 'text',
|
|
|
+ 'text' => '瑜伽课',
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'type' => 'text',
|
|
|
+ 'text' => '2024-05-10 12:30',
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ]
|
|
|
+
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ $body = json_encode($body);
|
|
|
+
|
|
|
+ $rs = curl_post($url,$body,$header);
|
|
|
+ dump($rs);
|
|
|
+ }
|
|
|
+
|
|
|
+/*
|
|
|
+套餐到期提醒
|
|
|
+Package expiration reminder
|
|
|
+
|
|
|
+Hi,{{1}},您购买的套餐{{2}}将于{{3}}过期,建议您在过期内使用完毕!
|
|
|
+Hi, {{1}}, the package {{2}} you purchased will expire on {{3}}. We recommend that you use it up within the expiration date!
|
|
|
+*/
|
|
|
+
|
|
|
|
|
|
}
|