diff --git a/docs/templates.md b/docs/templates.md
index ba24438d..7b36831d 100644
--- a/docs/templates.md
+++ b/docs/templates.md
@@ -7,8 +7,7 @@ This is the list of Functions available in this repo:
* [Hello Messaging](https://github.com/twilio-labs/function-templates/blob/main/hello-messaging): Function to get you started with Twilio Prog. Messaging
* [Never gonna give you up](https://github.com/twilio-labs/function-templates/blob/main/never-gonna-give-you-up): Never gonna let you down. Plays a song to a phone call
* [Forward Call](https://github.com/twilio-labs/function-templates/blob/main/forward-call): Forwards an incoming call to another number
-* [Forward Message](https://github.com/twilio-labs/function-templates/blob/main/forward-message): Forwards incoming messages to another number
-* [Forward Message to Multiple Numbers](https://github.com/twilio-labs/function-templates/blob/main/forward-message-multiple): Forwards incoming messages to a set of numbers
+* [Forward Message](https://github.com/twilio-labs/function-templates/blob/main/forward-message): Forwards incoming messages to another number or to a set of numbers
* [Forward Message to Email via SendGrid](https://github.com/twilio-labs/function-templates/blob/main/forward-message-sendgrid): Uses SendGrid to forward incoming messages via email
* [Voicemail](https://github.com/twilio-labs/function-templates/blob/main/voicemail): Forwards calls during business hours. Records messages otherwise.
* [Forward Message to Email via Sparkpost](https://github.com/twilio-labs/function-templates/blob/main/forward-message-sparkpost): Uses Sparkpost to forward incoming messages via email
diff --git a/env-variables.manifest.json b/env-variables.manifest.json
index b4e65e6b..5bf275b3 100644
--- a/env-variables.manifest.json
+++ b/env-variables.manifest.json
@@ -62,35 +62,13 @@
}
],
"forward-message": [
- {
- "key": "MY_PHONE_NUMBER",
- "required": true,
- "format": "phone_number",
- "description": "Messages sent to your Twilio number will get forwarded to this E.164-formatted phone number",
- "link": "https://www.twilio.com/docs/glossary/what-e164",
- "default": "+12223334444",
- "configurable": true,
- "contentKey": null
- },
- {
- "key": "TWILIO_SMS_WEBHOOK_URL",
- "required": true,
- "format": "text",
- "description": "The path to the webhook",
- "link": null,
- "default": "/forward-message",
- "configurable": false,
- "contentKey": null
- }
- ],
- "forward-message-multiple": [
{
"key": "FORWARDING_NUMBERS",
"required": true,
"format": "list(phone_number)",
"description": "A list of numbers in E.164 format you want to forward incoming messages to, separated by commas",
- "link": null,
- "default": "+12223334444,+491761234567",
+ "link": "https://www.twilio.com/docs/glossary/what-e164",
+ "default": "+12223334444,+12223335555",
"configurable": true,
"contentKey": null
},
@@ -100,7 +78,7 @@
"format": "text",
"description": "The path to the webhook",
"link": null,
- "default": "/forward-message-multiple",
+ "default": "/forward-message",
"configurable": false,
"contentKey": null
}
@@ -472,7 +450,7 @@
"format": "phone_number",
"description": "A comma separated list of numbers in E.164 format that you want to dial in order",
"link": null,
- "default": "+12223334444,+491761234567",
+ "default": "+12223334444,+12223335555",
"configurable": true,
"contentKey": null
},
@@ -1288,7 +1266,7 @@
"format": "phone_number",
"description": "A comma separated list of numbers in E.164 format that are allowed to trigger a broadcast",
"link": null,
- "default": "+12223334444,+491761234567",
+ "default": "+12223334444,+12223335555",
"configurable": true,
"contentKey": null
},
diff --git a/forward-message-multiple/.env b/forward-message-multiple/.env
deleted file mode 100644
index e0c54233..00000000
--- a/forward-message-multiple/.env
+++ /dev/null
@@ -1,8 +0,0 @@
-# description: A list of numbers in E.164 format you want to forward incoming messages to, separated by commas
-# format: list(phone_number)
-# required: true
-FORWARDING_NUMBERS=+12223334444,+491761234567
-
-# description: The path to the webhook
-# configurable: false
-TWILIO_SMS_WEBHOOK_URL=/forward-message-multiple
\ No newline at end of file
diff --git a/forward-message-multiple/README.md b/forward-message-multiple/README.md
deleted file mode 100644
index eb6bdb73..00000000
--- a/forward-message-multiple/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Forward Message to Multiple Numbers
-
-This Function in `forward-message-multiple.js` will return the TwiML required to forward an incoming SMS message to each number in a comma separated list of numbers set in the environment variables.
-
-### Environment variables
-
-This Function expects one environment variable to be set.
-
-| Variable | Meaning |
-| :------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `FORWARDING_NUMBERS` | A list of numbers [in E.164 format](https://support.twilio.com/hc/en-us/articles/223183008-Formatting-International-Phone-Numbers) you want to forward incoming messages to, separated by commas |
-
-### Parameters
-
-This Function expects the incoming request to be a messaging webhook. The parameters that will be used are `From` and `Body`.
diff --git a/forward-message-multiple/assets/index.html b/forward-message-multiple/assets/index.html
deleted file mode 100644
index 59976aa7..00000000
--- a/forward-message-multiple/assets/index.html
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
- Get started with your Twilio Functions!
-
-
-
-
-
-
-
-
Your live application with Twilio is ready to use!
-
-
-
-
Get started with your application
-
- Follow these steps to try out your new app:
-
-
- This app will return the
- TwiML
- required to forward an incoming SMS message to each number in the comma separated list of
- numbers set in the environment variables.
-
-
-
Text any message to your Twilio phone number
-
Every phone number you specified should receive the response message from Twilio
-
-
-
-
-
-
-
Troubleshooting
-
-
- Check the
-
- phone number configuration
-
- and make sure the Twilio phone number you want for your app has a SMS webhook
- configured to point at the following URL
-
-
-
-
-
-
-
-
-
diff --git a/forward-message-multiple/changelog.md b/forward-message-multiple/changelog.md
deleted file mode 100644
index 3982d461..00000000
--- a/forward-message-multiple/changelog.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Changelog
-
-## [Unreleased]
-
-## [1.0.0]
-### Added
-- Initial release.
-
diff --git a/forward-message-multiple/functions/forward-message-multiple.protected.js b/forward-message-multiple/functions/forward-message-multiple.protected.js
deleted file mode 100644
index e57ef4ce..00000000
--- a/forward-message-multiple/functions/forward-message-multiple.protected.js
+++ /dev/null
@@ -1,7 +0,0 @@
-exports.handler = function (context, event, callback) {
- const twiml = new Twilio.twiml.MessagingResponse();
- context.FORWARDING_NUMBERS.split(/,\s?/).forEach((number) => {
- twiml.message({ to: number }, `From: ${event.From}. Body: ${event.Body}`);
- });
- callback(null, twiml);
-};
diff --git a/forward-message-multiple/package.json b/forward-message-multiple/package.json
deleted file mode 100644
index 546763d9..00000000
--- a/forward-message-multiple/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": "1.0.0",
- "private": true,
- "dependencies": {}
-}
diff --git a/forward-message-multiple/tests/forward-message-multiple.test.js b/forward-message-multiple/tests/forward-message-multiple.test.js
deleted file mode 100644
index 954a405c..00000000
--- a/forward-message-multiple/tests/forward-message-multiple.test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-const helpers = require('../../test/test-helper');
-const forwardMessageMultiple =
- require('../functions/forward-message-multiple.protected').handler;
-const Twilio = require('twilio');
-
-const context = {
- FORWARDING_NUMBERS: 'TwilioNumber1, TwilioNumber2',
-};
-const event = {
- Body: 'Hello',
- From: 'ExternalNumber',
-};
-
-beforeAll(() => {
- helpers.setup(context);
-});
-
-afterAll(() => {
- helpers.teardown();
-});
-
-test('returns a MessagingResponse', (done) => {
- const callback = (_err, result) => {
- expect(result).toBeInstanceOf(Twilio.twiml.MessagingResponse);
- done();
- };
-
- forwardMessageMultiple(context, event, callback);
-});
-
-test('forwards the message to both numbers from the context', (done) => {
- const callback = (_err, result) => {
- const twiml = result.toString();
- expect(twiml).toMatch('to="TwilioNumber1"');
- expect(twiml).toMatch('to="TwilioNumber2"');
- expect(twiml.match(/ {
- const callback = (_err, result) => {
- expect(result.toString()).toMatch(
- `>From: ${event.From}. Body: ${event.Body}`
- );
- done();
- };
-
- forwardMessageMultiple(context, event, callback);
-});
diff --git a/forward-message/.env b/forward-message/.env
index 3042406d..e9480f51 100644
--- a/forward-message/.env
+++ b/forward-message/.env
@@ -1,8 +1,8 @@
-# description: Messages sent to your Twilio number will get forwarded to this E.164-formatted phone number
-# format: phone_number
+# description: A list of numbers in E.164 format you want to forward incoming messages to, separated by commas
+# format: list(phone_number)
# required: true
# link: https://www.twilio.com/docs/glossary/what-e164
-MY_PHONE_NUMBER=+12223334444
+FORWARDING_NUMBERS=+12223334444,+491761234567
# description: The path to the webhook
# configurable: false
diff --git a/forward-message/README.md b/forward-message/README.md
index 695e882a..dae84c9d 100644
--- a/forward-message/README.md
+++ b/forward-message/README.md
@@ -1,6 +1,6 @@
# Forward Message
-This Function in `forward-message.js` will return the TwiML required to forward an incoming SMS message to a number that is set in the environment variables.
+This Function in `forward-message.js` returns the TwiML required to forward an incoming SMS message to a single number or each number in a comma-separated list set in the environment variables.
### Environment variables
@@ -8,7 +8,7 @@ This Function expects one environment variable to be set.
| Variable | Meaning |
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `MY_PHONE_NUMBER` | The number you want to forward incoming messages to [in E.164 format](https://support.twilio.com/hc/en-us/articles/223183008-Formatting-International-Phone-Numbers) |
+| `FORWARDING_NUMBERS` | A list of numbers [in E.164 format](https://support.twilio.com/hc/en-us/articles/223183008-Formatting-International-Phone-Numbers) you want to forward incoming messages to, separated by commas |
### Parameters
diff --git a/forward-message/assets/index.html b/forward-message/assets/index.html
index 3d77720b..2e754443 100644
--- a/forward-message/assets/index.html
+++ b/forward-message/assets/index.html
@@ -44,18 +44,18 @@
Get started with your application
-
- Follow these steps to try out your new app:
-
This app will return the
TwiML
- required to forward an incoming SMS message to the number that is set in the environment
- variables.
+ required to forward an incoming SMS message to each number in the comma separated list of
+ numbers set in the environment variables.
+
+
+ Follow these steps to try out your new app:
Text any message to your Twilio phone number
-
Receive the response message from Twilio
+
Every phone number you specified should receive the response message from Twilio