From 527fa0876759ef424701d91ad99f61b2f55112ba Mon Sep 17 00:00:00 2001 From: Michelle Norton Date: Fri, 25 Aug 2023 13:24:58 -0700 Subject: [PATCH] Fix Typos, and make user input clear Index.html: added character limit and place holder to message field to Twilio's character limit. Config.json: Replaced values with clear place markers. Corrected urls to add JourneyBuilder to match Route.js CustomActivity.js: Updated To place marker to be clear to user. ReadMe.md: Fixed typos, updated steps and language for clarity, added JB attribute group step required for finding the DE by the methods used in customActivity.js --- README.md | 15 ++++++++------- public/config.json | 12 ++++++------ public/index.html | 2 +- public/js/customActivity.js | 2 +- routes/activity.js | 1 + 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index dceead6e9..79c9f0c17 100755 --- a/README.md +++ b/README.md @@ -50,15 +50,15 @@ While you can certainly tweak this example to send directly from a short code, y #### Configure the Twilio SMS Activity 1. Open /public/config.json and: -2. Replace applicationExtensionKey for the value you got from step 8 in configuring your package in Marketing Cloud +2. Replace applicationExtensionKey for the Unique Key value you got from step 8 in configuring your package in Marketing Cloud. Line 33 3. Replace [your-app-URL] with the domain for your specific heroku app: - https://YOUR-APP-URL.herokuapp.com/journeybuilder/execute -- https://YOUR-APP-URL.herokuapp.com/publish -- https://YOUR-APP-URL.herokuapp.com/validate -- https://YOUR-APP-URL.herokuapp.com/stop -- https://YOUR-APP-URL.herokuapp.com/save +- https://YOUR-APP-URL.herokuapp.com/journeybuilder/publish +- https://YOUR-APP-URL.herokuapp.com/journeybuilder/validate +- https://YOUR-APP-URL.herokuapp.com/journeybuilder/stop +- https://YOUR-APP-URL.herokuapp.com/journeybuilder/save 4. Open public/js/customActivity.js and -5. Replace {{Contact.Attribute.TwilioV1.TwilioNumber}} with the correct data extension and column name that will be used to reference the TO phone number. +5. Replace {{Contact.Attribute.[Data Extension Name].[ColumnName]}} with the correct data extension and column name that will be used to reference the TO phone number. - {{Contact.Attribute.YOUR-DATA-EXTENSION-NAME.YOUR-PHONE-NUMBER-COLUMN}} - This is something that is typically customized when setting up Marketing Cloud but is needed in order for Twilio to understand WHO the message needs to be sent to. @@ -82,7 +82,8 @@ If you want, the Account SID, auth token even the Messaging Service SID can be h #### Testing Twilio SMS Activity 1. Login into Marketing Cloud and navigate to Journey Builder and create a new Journey. -2. You should be able to the Twilio SMS custom activity and drag it into the canvas +2. Create an attribute group to connect your Data Exention to the contact model. You can chnange the code to find the DataExtensionKey dynamically so that this doesn't have to be done. +2. You should be able to see the Twilio SMS custom activity and drag it into the canvas 3. Click into the activity and fill out the Account SID, Auth Token, Messaging Service SID and the body for your SMS/MMS message. 4. Better yet, test out 5 different variations of your SMS message to optimize campaign performance(optional): diff --git a/public/config.json b/public/config.json index 20acd2b1f..c6ccfde01 100755 --- a/public/config.json +++ b/public/config.json @@ -21,7 +21,7 @@ } ], "outArguments": [], - "url": "https://twilio-sfmc.herokuapp.com/journeybuilder/execute", + "url": "https://YOUR-APP-URL.herokuapp.com/journeybuilder/execute", "verb": "POST", "body": "", "format": "json", @@ -30,9 +30,9 @@ } }, "configurationArguments": { - "applicationExtensionKey": "e962d1d4-8b07-4e76-89be-ecd1f1423b6d", + "applicationExtensionKey": "[Replace with your Application Extension Key from Marketing Cloud See Previous Step 8]", "save": { - "url": "https://twilio-sfmc.herokuapp.com/save", + "url": "https://YOUR-APP-URL.herokuapp.com/journeybuilder/save", "verb": "POST", "body": "", "format": "json", @@ -40,7 +40,7 @@ "timeout": 2000 }, "publish": { - "url": "https://twilio-sfmc.herokuapp.com/publish", + "url": "https://YOUR-APP-URL.herokuapp.com/journeybuilder/publish", "verb": "POST", "body": "", "format": "json", @@ -48,7 +48,7 @@ "timeout": 2000 }, "validate": { - "url": "https://twilio-sfmc.herokuapp.com/validate", + "url": "https://YOUR-APP-URL.herokuapp.com/journeybuilder/validate", "verb": "POST", "body": "", "format": "json", @@ -56,7 +56,7 @@ "timeout": 2000 }, "stop": { - "url": "https://twilio-sfmc.herokuapp.com/stop", + "url": "https://YOUR-APP-URL.herokuapp.com/journeybuilder/stop", "verb": "POST", "body": "", "format": "json", diff --git a/public/index.html b/public/index.html index f024a2139..4bb03604c 100755 --- a/public/index.html +++ b/public/index.html @@ -40,7 +40,7 @@

Create a Twilio SMS message:


- +
diff --git a/public/js/customActivity.js b/public/js/customActivity.js index e24484774..6762e41e7 100755 --- a/public/js/customActivity.js +++ b/public/js/customActivity.js @@ -100,7 +100,7 @@ define([ "authToken": authToken, "messagingService": messagingService, "body": body, - "to": "{{Contact.Attribute.TwilioV1.TwilioNumber}}" //<----This should map to your data extension name and phone number column + "to": "{{Contact.Attribute.[Data Extension Name].[ColumnName]}}" //<----This should map to your data extension name and phone number column }]; payload['metaData'].isConfigured = true; diff --git a/routes/activity.js b/routes/activity.js index 967c75722..f2e275ae4 100755 --- a/routes/activity.js +++ b/routes/activity.js @@ -45,6 +45,7 @@ function logData(req) { console.log("protocol: " + req.protocol); console.log("secure: " + req.secure); console.log("originalUrl: " + req.originalUrl); + console.log("DEID:" +req.eventDefinitionKey); } /*