1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00

feat: use param instead

This commit is contained in:
loks0n 2024-05-30 16:34:43 +01:00
parent c6a520909e
commit 72cca45d6d

View file

@ -400,9 +400,7 @@ class Messaging extends Action
'twilio' => [ 'twilio' => [
'accountSid' => $user, 'accountSid' => $user,
'authToken' => $password, 'authToken' => $password,
// Twilio Messaging Service SIDs always start with MG 'messagingServiceSid' => $smsDSN->getParam('messagingServiceSid') ?? null
// https://www.twilio.com/docs/messaging/services
'messagingServiceSid' => \str_starts_with($from, 'MG') ? $from : null
], ],
'textmagic' => [ 'textmagic' => [
'username' => $user, 'username' => $user,
@ -425,7 +423,7 @@ class Messaging extends Action
}, },
'options' => match ($host) { 'options' => match ($host) {
'twilio' => [ 'twilio' => [
'from' => \str_starts_with($from, 'MG') ? null : $from 'from' => $smsDSN->getParam('messagingServiceSid') ? null : $from
], ],
default => [ default => [
'from' => $from 'from' => $from