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
| TWILIO_PHONE_NUMBER | The Twilio phone number to send broadcast SMS from | Yes |
16
-
| PASSCODE | Choose a passcode for your app. Users have to use this passcode to send SMS broadcasts or delete all subscriptions | Yes |
17
-
| BROADCAST_NOTIFY_SERVICE_SID | SID of your Twilio Notify Service. Otherwise one will automatically be provisioned for you. | No |
18
-
| MESSAGING_SERVICE_SID | SID of a Twilio Messaging Service. Otherwise one will automatically be provisioned for you. | No |
19
-
| VERIFY_SERVICE_SID | SID of your Twilio Verify Service. Create one [here](https://www.twilio.com/console/verify/services). Otherwise one will automatically be provisioned for you. | No |
| TWILIO_PHONE_NUMBER | The Twilio phone number to send broadcast SMS from | Yes |
16
+
| AUTH_USERNAME | Choose a passcode for your app. Users have to use this username and passcode to send SMS broadcasts or delete all subscriptions | Yes |
17
+
| AUTH_PASSCODE | Choose a passcode for your app. Users have to use this username and passcode to send SMS broadcasts or delete all subscriptions | Yes |
18
+
| BROADCAST_NOTIFY_SERVICE_SID | SID of your Twilio Notify Service. Otherwise one will automatically be provisioned for you. | No |
19
+
| MESSAGING_SERVICE_SID | SID of a Twilio Messaging Service. Otherwise one will automatically be provisioned for you. | No |
20
+
| VERIFY_SERVICE_SID | SID of your Twilio Verify Service. Create one [here](https://www.twilio.com/console/verify/services). Otherwise one will automatically be provisioned for you. | No |
20
21
21
22
### Function Parameters
22
23
23
24
`start-verify.js` expects the following parameters:
`broadcast.js` has to be authenticated using HTTP Basic Auth using `admin` as username an the configured `PASSCODE` as password. It expects the following parameters:
30
+
`broadcast.js` has to be authenticated using HTTP Basic Auth using the configured `AUTH_USERNAME` as the username and the configured `AUTH_PASSCODE` as the password. It expects the following parameters:
|`to`| Subscriber phone number. Used for identity. | Yes |
41
-
|`code`| One-time passcode sent via SMS. | Yes |
42
-
|`tags`| Notify [tags](https://www.twilio.com/docs/notify/api/notification-resource#create-a-notification-resource) to filter broadcast. Defaults to 'all'. | No |
|`to`| Subscriber phone number. Used for identity. | Yes|
42
+
|`code`| One-time passcode sent via SMS. | Yes|
43
+
|`tags`| Notify [tags](https://www.twilio.com/docs/notify/api/notification-resource#create-a-notification-resource) to filter broadcast. Defaults to 'all'. | No|
43
44
44
45
## Setup
45
46
@@ -84,7 +85,7 @@ You will need the generated SID for this service to configure your environment i
84
85
85
86
### Deploy the Function template
86
87
87
-
Add the Notify Service SID to the `.env` file as `BROADCAST_NOTIFY_SERVICE_SID` and the Verify Service SID as `VERIFY_SERVICE_SID`. Add any passcode for the admin that is permitted to send broadcast messages to the `.env` file as `PASSCODE`.
88
+
Add the Notify Service SID to the `.env` file as `BROADCAST_NOTIFY_SERVICE_SID` and the Verify Service SID as `VERIFY_SERVICE_SID`. Add any username and passcode for the admin that is permitted to send broadcast messages to the `.env` file as `AUTH_USERNAME` and `AUTH_PASSCODE`, respectively.
88
89
89
90
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)
90
91
@@ -100,4 +101,4 @@ In a few moments your Function should be deployed! Grab its URL from the results
100
101
101
102
Once the Function is deployed, people can subscribe via the form on `/subscribe.html`. Users can respond `stop/start` to use Twilio's built-in stop handling to opt a user out from, or back in to, receiving messages (check out this article for [further details on Twilio's built-in features for handling opt-out/in keywords](https://support.twilio.com/hc/en-us/articles/223134027-Twilio-support-for-opt-out-keywords-SMS-STOP-filtering-)).
102
103
103
-
Administrators can use the form on `/broadcast.html` to send a message out to all subscribed users. This will send an OTP to the administrator for verification before broadcasting a message.
104
+
Administrators can use the form on `/broadcast.html` to send a message out to all subscribed users. This will send an OTP to the administrator for verification before broadcasting a message.
0 commit comments