7/1/2023 0 Comments Mjml gmail![]() ![]() 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. MJML, or Mailjet Markup Language, is an open-source method for coding responsive emails. 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. mjml file Ill go through those in a second, but the first thing I want to show you is the index.html file that gets exported in the root of the directory if. 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. iRyusa mentioned this issue on Jan 16, 2017. ngarnier added the Feature request label on Oct 20, 2016. ![]() This action repeatedly happens whenever you go to a restaurant. ngarnier added this to the 3.2.0 milestone on Oct 20, 2016. Being in a restaurant, the first thing that gets presented to you is the menu. ![]()
0 Comments
Leave a Reply. |