Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. foreach ($numbers as $number){
  2. $number = $twilio->lookups->v1->phoneNumbers($user->mobil)->fetch(['countryCode' => 'NO'])->phoneNumber;
  3.  
  4. try {
  5. // Send SMS
  6. $twilio->messages->create(
  7. $number,
  8. [
  9. 'from' => $settings->twilioNumber,
  10. 'body' => $request->post('body')
  11. ]
  12. );
  13. } catch (Exception $e) {
  14. continue; // Continue (loop) to next number as this one failed/is invalid.
  15. }
  16. }
  17.  
  18. use TwilioExceptionsConfigurationException;
  19. use TwilioExceptionsDeserializeException;
  20. use TwilioExceptionsEnvironmentException;
  21. use TwilioExceptionsHttpException;
  22. use TwilioExceptionsRestException;
  23. use TwilioExceptionsTwimlException;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement