twilio

🔧 dataClient

Donnée du client
function dataClient() { global $global_message; $client = fwc7_data_objet_att('', 80, $this->client); $attMobile = fwp7_param_template_att_get_number('',80, 'mobile'); if (empty($client[$attMobile])) { // Log communication $dataLog = [ 'att1' => $this->client, 'att2' => 'sms', 'attf100' => (new DateTime())->format('Ymdhi'), 'att3' => 'Pas de SMS envoyé car pas de numéro de mobile dans la fiche client', // ... (truncated)

↩️ Returns

(void)

⚠️ Throws


🔧 dataSmsTemplate

Template SMS
function dataSmsTemplate() { global $global_message; $smsTemplate = fwp7_param_sms_type_detail('', $this->smsID); if (empty($smsTemplate)) { // Log communication $dataLog = [ 'att1' => $this->client, 'att2' => 'sms', 'attf100' => (new DateTime())->format('Ymdhi'), 'att3' => 'Pas de SmS envoyé, template SMS non trouvé', 'att4' => $this->id_obje, // ... (truncated)

🔧 replaceSmsVariables

Remplace le text dans le SMS
function replaceSmsVariables() { $listeCivilite = fwc7_data_liste_valeurs('', 2); $variables = array_merge([ 'client' => $this->nomClient, 'civilite' => $listeCivilite[$this->civiliteClient], 'lien_avis_google' => $this->lienAvisGoogle, ], $this->dataToReplace); foreach ($variables as $key => $value) { $this->smsTemplate = str_replace('[' . $key . ']', $value, $this->smsTemplate); } // ... (truncated)

🔧 sendSMS

Envoie du SMS
function sendSMS() { global $global_message; $message = $this->replaceSmsVariables(); $data = http_build_query([ 'From' => $this->fromNumber, 'To' => $this->numeroClient, 'Body' => $message ]); $ch = curl_init($this->apiUrl); curl_setopt($ch, CURLOPT_POST, true); // ... (truncated)