From ae2e25413ff82b9420d98eab04b322519386fb76 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Mon, 28 Sep 2020 14:38:15 +1000 Subject: [PATCH] documentation: service sid config (#108) --- README.md | 10 +++++++++- config/twilio-notification-channel.php | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 399d9c3..7be4064 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ You are viewing the `3.x` documentation. [Click here](https://github.com/laravel ## Contents - [Installation](#installation) - - [Setting up your Twilio account](#setting-up-your-twilio-account) - [Usage](#usage) - [Available Message methods](#available-message-methods) - [Changelog](#changelog) @@ -45,6 +44,7 @@ TWILIO_ACCOUNT_SID=1234 # always required TWILIO_FROM=100000000 # optional default from TWILIO_ALPHA_SENDER=HELLO # optional TWILIO_DEBUG_TO=23423423423 # Set a number that call calls/messages should be routed to for debugging +TWILIO_SMS_SERVICE_SID=MG0a0aaaaaa00aa00a00a000a00000a00a # Optional but recommended ``` ### Advanced configuration @@ -62,6 +62,13 @@ exception codes from [the documentation](https://www.twilio.com/docs/api/errors) If you want to suppress all errors, you can set the option to `['*']`. The errors will not be logged but notification failed events will still be emitted. +#### Recommended Configuration + +Twilio recommends always using a [Messaging Service](https://www.twilio.com/docs/sms/services) because it gives you + access to features like Advanced Opt-Out, Sticky Sender, Scaler, Geomatch, Shortcode Reroute, and Smart Encoding. + +Having issues with SMS? Check Twilio's [best practices](https://www.twilio.com/docs/sms/services/services-best-practices). + ## Upgrading from 2.x to 3.x If you're upgrading from version `2.x`, you'll need to make sure that your set environment variables match those above @@ -161,6 +168,7 @@ public function routeNotificationForTwilio() - `from('')`: Accepts a phone to use as the notification sender. - `content('')`: Accepts a string value for the notification body. +- `messagingServiceSid('')`: Accepts a messaging service SID to handle configuration. #### TwilioCallMessage diff --git a/config/twilio-notification-channel.php b/config/twilio-notification-channel.php index bb58127..04e69c6 100644 --- a/config/twilio-notification-channel.php +++ b/config/twilio-notification-channel.php @@ -9,6 +9,11 @@ 'from' => env('TWILIO_FROM'), // optional 'alphanumeric_sender' => env('TWILIO_ALPHA_SENDER'), + /** + * See https://www.twilio.com/docs/sms/services. + */ + 'sms_service_sid' => env('TWILIO_SMS_SERVICE_SID'), + /** * Specify a number where all calls/messages should be routed. This can be used in development/staging environments * for testing.