diff --git a/include/config/config.xml b/include/config/config.xml index 05d1130ba..0189b23d7 100755 --- a/include/config/config.xml +++ b/include/config/config.xml @@ -171,8 +171,6 @@ _DOMAIN_ - +1_PHONE_ - +1_PHONE_ _KEY_ _KEY_ diff --git a/include/library/Crunchbutton/Message/Sms.php b/include/library/Crunchbutton/Message/Sms.php index 0918d682a..d093a9acc 100644 --- a/include/library/Crunchbutton/Message/Sms.php +++ b/include/library/Crunchbutton/Message/Sms.php @@ -1,6 +1,9 @@ site->config('twilio-number')->value); + } public static function send($from, $to = null, $message = null) { $break = false; @@ -25,15 +28,8 @@ class Crunchbutton_Message_Sms extends Crunchbutton_Message { $to = [$to]; } - $env = c::getEnv(); - if ($from == 'driver') { - $from = c::config()->twilio->{$env}->outgoingTextDriver; - } elseif ($from == 'restaurant') { - $from = c::config()->twilio->{$env}->outgoingTextRestaurant; - } else { - $from = c::config()->twilio->{$env}->outgoingTextCustomer; - } - + $numbers = self::numbers(); + $from = '+1'.$numbers[array_rand($numbers)]; $message = trim($message); if ($break) { @@ -72,7 +68,7 @@ class Crunchbutton_Message_Sms extends Crunchbutton_Message { } // dont message our own numbers - if (in_array($t, c::config()->twilio->numbers)) { + if (in_array($t, $numbers)) { continue; }