Created
January 27, 2019 16:29
-
-
Save JonEastman/271e6b0d2d19247c300ef794ad1aba0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($messages as $message) { | |
try { | |
$text = $client->messages->create( | |
$message->getPhone(), | |
array( | |
'from' => ‘+12629577957’, | |
'body' => ‘Text message here’ | |
) | |
); | |
} catch (Twilio\Exceptions\TwilioException $twilioException) { | |
// Log specific Twilio error & I’d recommend setting some sort of status as failed | |
} catch (\Exception $exception) { | |
// Log general error & I’d recommend setting some sort of status as failed | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment