Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ($numbers as $number){
- $number = $twilio->lookups->v1->phoneNumbers($user->mobil)->fetch(['countryCode' => 'NO'])->phoneNumber;
- try {
- // Send SMS
- $twilio->messages->create(
- $number,
- [
- 'from' => $settings->twilioNumber,
- 'body' => $request->post('body')
- ]
- );
- } catch (Exception $e) {
- continue; // Continue (loop) to next number as this one failed/is invalid.
- }
- }
- use TwilioExceptionsConfigurationException;
- use TwilioExceptionsDeserializeException;
- use TwilioExceptionsEnvironmentException;
- use TwilioExceptionsHttpException;
- use TwilioExceptionsRestException;
- use TwilioExceptionsTwimlException;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement