5. Run serverless deploy --stage prod
to deploy
6. Create an IAM user with the proper credentials to invoke this lambda function as per these instructions. You will need this again in Step 5.
Note: Retool offers additional security options such as SSO that can be leveraged to further tighten the scope of who can access customer data.
In this application, the store rep will be able to send a loyalty coupon or product recommendation to the customer picking up in-store. If the customer’s preferred channel is email, we will use SendGrid to send the loyalty coupon or product recommendation information in an email.
If you do not have a Twilio account, we highly recommend doing the SendGrid 5 minute quickstart to get setup. After you are done, please keep the API key handy to be used in Step 5. Otherwise, generate an API key in your current account to be used in Step 5.
In this application, the store rep will be able to send a loyalty coupon or product recommendation to the customer picking up in-store. If the customer’s preferred channel is SMS, we will use Twilio to send the loyalty coupon or product recommendation information in an SMS.
If you do not have a Twilio account, please follow this quickstart guide. Obtain your Account SID and Auth Token from the console to be used in Step 5.
You can now get started with this application in one click by visiting https://retool.com/templates/twilio-segment-app. Click to clone the template and sign up for Retool.
You’ll then be in the app editor view where you can configure your application. First, we are going to connect our resources which are the various APIs (internal or 3rd party) and DBs we need to build an app.
Connect Segment
We’ll want to connect the Lambda function that you wrote to connect to your Segment Source in Step 3.
First, you’ll want to go to the resources page and add a Lambda resource. Then enter a name, AWS region, Access Key ID and Secret. More information on connecting to Lambda here: https://docs.retool.com/docs/lambda-integration.
Then in the app editor connect all the Lambda queries to that new resource by selecting it from the resource dropdown at the top of the query editor.