mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-06 14:46:27 +02:00
Change phone adapter meta number to type phone_number + add support for boolean adapter data + add a noStaupClose to ovh adapter
This commit is contained in:
parent
9c9f99c87a
commit
a0f3784baa
8 changed files with 85 additions and 17 deletions
|
@ -154,7 +154,7 @@ class OctopushVirtualNumberAdapter implements AdapterInterface
|
|||
'title' => 'Numéro de téléphone virtuel',
|
||||
'description' => 'Numéro de téléphone virtuel Octopush à utiliser.',
|
||||
'required' => true,
|
||||
'number' => true,
|
||||
'type' => 'phone_number',
|
||||
],
|
||||
[
|
||||
'name' => 'sms_type',
|
||||
|
|
|
@ -144,6 +144,13 @@ namespace adapters;
|
|||
'description' => 'Paramètre "Consumer Key" obtenu lors de la génération de la clef API OVH.',
|
||||
'required' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'no_stop_clause',
|
||||
'title' => 'Désactiver la clause "STOP SMS" automatique',
|
||||
'description' => 'En cochant ce paramètre, la clause "STOP SMS" ne sera pas ajoutée automatiquement au SMS par OVH.',
|
||||
'required' => false,
|
||||
'type' => 'boolean'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -222,6 +229,7 @@ namespace adapters;
|
|||
'message' => $text,
|
||||
'receivers' => [$destination],
|
||||
'senderForResponse' => true,
|
||||
'noStopClause' => (bool) ($this->data['no_stop_clause'] ?? false),
|
||||
];
|
||||
|
||||
if ($this->data['sender'])
|
||||
|
@ -325,7 +333,7 @@ namespace adapters;
|
|||
{
|
||||
$success = true;
|
||||
|
||||
if ($this->data['sender'] && (mb_strlen($this->data['sender']) < 3 || mb_strlen($this->data['sender'] > 11)))
|
||||
if ($this->data['sender'] && (mb_strlen($this->data['sender']) < 3 || mb_strlen($this->data['sender']) > 11))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -334,6 +342,7 @@ namespace adapters;
|
|||
$endpoint = '/sms/' . $this->data['service_name'];
|
||||
$response = $this->api->get($endpoint);
|
||||
|
||||
|
||||
return $success && (bool) $response;
|
||||
}
|
||||
catch (\Throwable $t)
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace adapters;
|
|||
'title' => 'Numéro',
|
||||
'description' => 'Numéro de téléphone virtuel chez OVH.',
|
||||
'required' => true,
|
||||
'number' => true,
|
||||
'type' => 'phone_number',
|
||||
],
|
||||
[
|
||||
'name' => 'app_key',
|
||||
|
|
|
@ -140,7 +140,7 @@ class TwilioVirtualNumberAdapter implements AdapterInterface
|
|||
'title' => 'Numéro de téléphone virtuel',
|
||||
'description' => 'Numéro de téléphone virtuel Twilio à utiliser parmis les numéro actifs (format international), <a href="https://www.twilio.com/console/phone-numbers/incoming" target="_blank">voir la liste ici</a>.',
|
||||
'required' => true,
|
||||
'number' => true,
|
||||
'type' => 'phone_number',
|
||||
],
|
||||
[
|
||||
'name' => 'status_change_callback',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue