It helps organizations such as Stripe, Lyft, Airbnb, Vacasa, and lots more to provide excellent customer service to their users. Despite providing quite a large number of features, it ensures that you find information about the tool you are interested in right away.Ī large community of users Twilio has a large community of users, including developers and businesses. Twilio’s website is also easy to navigate. After creating an account, it provides a monitor tab on your dashboard where you can view insights into every activity you performed. Great user experience Twilio has a great user experience. In this section, you will learn more about why you should choose Twilio when adding a means of communication to your software applications. The Coupon Generator generates a random set of strings, collects the user’s phone number, and sends the coupon to the user via the phone number.īefore we go further, let’s learn more about a few reasons why you should choose Twilio. In this article, you will learn how to send messages to users via Twilio by building a Coupon Generator in Node.js. In addition to its well-crafted documentation, Twilio has a large community of users who create tutorials and organize events about numerous problems they have solved using Twilio and how it has contributed to the success of their businesses. It provides a robust API that allows you to add various forms of communication such as video chat functionality, interactive live video and audio streaming experience, phone calls, SMS, WhatsApp, emails, and chatbots to your software applications. Twilio is an efficient communication tool that offers a great user experience that enables you to set up, manage, and track every communication with your users. Then we will create a function that will be exported and be globally accessible through the rvices. TWILIONUM will be the exact phone number given by Twilio, and MYNUM should be the destination number. Where AC82a29b91a67xxxxxxxxx is your exact ACCOUNT SID and 81682479468249xxxxxxxxxxx is the same AUTH TOKEN you copied from your Twilio account. TWILIO_ACCOUNT_SID = AC82a29b91a67xxxxxxxxx Now, copy out your ACCOUNT SID and AUTH TOKEN. Log in to Your Twilio Account or create one if you don't already have it here. Let's install Twilio using the following command: Copying Your Twilio Credentials We will send an SMS whenever a user creates a comment using Twilio. api/comment/services folder and add paste this code to it: 1 Using Services to Send SMSĬreate a file called sms.js in the. However, we can achieve endless possibilities of functionalities with the Strapi Generated Services. We want to use the Service Strapi generated to send SMS when a user creates a new comment. The above command will create an empty collection called Comments. So your selection should look like the screenshot below: We want this content type to have two fields: user and description. Next, generate a content-type with the Strapi generate command below: npm run strapi generate Your selections should look like the screenshot below: This API is not for a plugin, select n.Creating Servicesįirst, we will create an API with its configurations, controller, and service. Yarn create strapi-app my-project -quickstartĪfter installation, navigate to and complete the form to create the first Administrator user. Let's spin up a project by creating a new application if you don't have one already. Whenever you create a new content type or model, Strapi generates a new service file that does nothing but could override the generic service created in the node_module. These are reusable functions that simplify controllers' logic. Services help you with the DRY principle, as they do what they even mean they serve. Controllers are responsible for controlling the flow of any application that follows the MVC framework, including Strapi. These actions get triggered when a client requests a particular route defined in the code. Controllers are where actions are stored. Therefore, it is nice that we employ the DRY (Don't Repeat Yourself) concept all the time to make things easier. In the same vein, so many events or activities get repeated in software engineering. This action repeatedly happens whenever you go to a restaurant. Being in a restaurant, the first thing that gets presented to you is the menu.
0 Comments
Leave a Reply. |