You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: sms-broadcast/README.md
+5-11
Original file line number
Diff line number
Diff line change
@@ -38,25 +38,19 @@ twilio serverless:init example --template=sms-broadcast && cd example
38
38
39
39
Before using this Function, you will need to create (or use an existing) Notify service and Messaging service. The Notify service will use the Messaging service to send out SMS messages. The Messaging service will be configured to send incoming messages to your Subscribe/Broadcast function.
40
40
41
-
### Create a Messaging Service
42
-
43
-
Go to the console and [create a messaging service](https://www.twilio.com/console/sms/services). Choose the "Notifications, Two-way" use case to preset some options on the service.
44
-
45
-
Once created, click on the left nav link for "Numbers" and add (or buy) a phone number to use with this service. This will be the phone number(s) your end users will interact with.
46
-
47
-
We'll need to come back here later - consider leaving this page open in a tab while you proceed to the next step in the console.
48
-
49
41
### Create a Notify Service
50
42
51
43
In the console, create a [Notify service](https://www.twilio.com/console/notify/services). Our function code uses Notify to store our subscriber list and to send out notifications. After your service is created, locate the Dropdown in your Notify service config labeled "Messaging Service SID". You should be able to choose the Messaging Service we created in the last step.
52
44
53
45
You will need the generated SID for this service to configure your environment in the next step.
54
46
55
-
Don't forget to save your changes!
47
+
### Create a Messaging Service
48
+
49
+
Once your [Notify service](https://www.twilio.com/console/notify/services) is created, go to its config page in the console and locate the Dropdown labeled "Messaging Service SID". Click the link next to that Dropdown labeled "Create a Messaging Service here". For the new Messaging Service's use case, choose "Not listed here". When prompted, add the phone number you want to use with this service to the Messaging Service's Sender Pool.
56
50
57
51
### Deploy the Function template
58
52
59
-
Add the Notify Service SID to the `.env` file as `BROADCAST_NOTIFY_SERVICE_SID`. Add the phone numbers of admins that are permitted to send broadcast messages to the `.env` file as `BROADCAST_ADMIN_NUMBERS`.
53
+
Add the Notify Service SID (which should start with `IS`) to the `.env` file as `BROADCAST_NOTIFY_SERVICE_SID`. Add the phone numbers of admins that are permitted to send broadcast messages to the `.env` file as `BROADCAST_ADMIN_NUMBERS`.
60
54
61
55
Deploy your functions and assets with the following command. Note: you must run this command from inside your project folder. [More details in the docs.](https://www.twilio.com/docs/labs/serverless-toolkit)
62
56
@@ -70,7 +64,7 @@ In a few moments your Function should be deployed! Grab its URL from the results
70
64
71
65
### Handle incoming messages with your Function
72
66
73
-
Go back to the [messaging service](https://www.twilio.com/console/sms/services) you created earlier. In its configuration, you'll see a checkbox for "Handle Incoming Messages". Click this box to enable the feature. In the text box that appears, paste in the URL to the Function we just deployed. Click "Save".
67
+
Go back to the [messaging service](https://www.twilio.com/console/sms/services) you created earlier. In the sidebar, look for the Integration menu item. Under the Incoming Messages section of the Integration configuration page, you'll see a radio button for "Send a webhook". Click this radio button, and in the "Request URL" textbox that appears, paste the URL to the Function we just deployed. Click "Save".
74
68
75
69
Now if all went well, you'll be able to start using your phone number for managing broadcasts and subscriptions!
0 commit comments