📜 ⬆️ ⬇️

Configuring web form functionality in MyTaskHelper: condition actions (triggers)

Greetings, dear habrayuzer! Today in the blog of the company MyTaskHelper I will talk about one popular function of the service. We are talking about actions on the condition (triggers) .


A condition action is the fulfillment of certain actions while observing predetermined conditions (criteria).


And before moving on to the practical part, I will give 3-4 examples by which it will become clear when the flexible function “Actions by condition” will help solve the planned task.


1. The status of the order sent via the Internet has changed and it is necessary to inform the buyer by sending him an e-mail or sms-message.


2. Depending on the user's choice, you should go to a particular web page. For example, when choosing payment through WebMoney or Yandex Money, we redirect the buyer to the appropriate page).


3. When entering certain data, you need to show the user a patterned message. For example:



4. Moreover, MyTaskHelper allows you to combine several criteria. For example, in the field “Choose a convenient delivery method” the client indicated “Pickup at Kutuzovskoe shosse, 36, office 18”, and in the “Choose a convenient payment method” field, he chose “Cash in office”. In this case, he will be shown a message with the schedule of the office.


And some practice :)


Having created any web form in MTH (here I will not talk in detail about creating and setting up a web form, to get acquainted with the algorithm, just visit our previous topic - Algorithm for creating multipage web forms in MyTaskHelper ), you can apply all of its fields to condition.


Let me remind you that in the previous topic we talked step by step about creating a multipage online order form in which all the fields were grouped in such a way that the module itself could be divided into 5 compact pages. But there is no limit to perfection and this web form is easy to make more functional by customizing some actions according to the condition .


To do this, go to the "Actions" menu and click the "Add" button.


Next, set up the criteria we need. In fact, from the first drop-down list, select the required field, from the second - the criterion, during the execution of which an action will be performed (Fig. 1).


image
Fig. one

For example, in our case it can be such simple actions as:



In the first case, in the list of fields, select "E-mail for communication", in the criteria - "not empty." In the next step, we add the name of the criterion, let's say it will be “E-mail for sending confirmation”. In the section “Perform an action when” we indicate “The form is completed”. As a result, as soon as our multipage web form is completed, the customer will immediately receive a corresponding notification to his e-mail. Everything, click "Create".


In order to set up a letter template, which will be sent to the user after filling out the form with him, proceed to editing the action by condition. In the "Recipients" select "Select the field e-mail". The point is that the web form created by us at the previous stage may contain several fields with the data type “Email Address”, we also need to select one specific field.


In the subject of our letter we will prescribe a template:


“Thank you | Name | Your order is accepted for processing!” ,


where | Name | - the name of the column from which the data on the customer's full name will be pulled automatically.


In the text of the message we have entered the following:


“Thank you | Name | Your order is accepted for processing on the site www.mysite.ru !
Best wishes,
team www.mysite.ru ! "


In the “Sender” section, we specify the sender's e-mail address; in “Reply to this email”, we enter an email address through which the customer can contact the owner of the web form.


Similar actions are repeated in the second case. So, in the list of fields, select "Phone for communication", in the criteria - "not empty." In the next step, add the name of the criterion, for example, “Order status alert”. In “Perform action when” we indicate “Record is updated” (this criterion will work at the moment when the site administrator changes the status of the order — this is where the hidden field called “Order status” (data type - radio button) with “Accepted to execution "," Prepared for delivery "," Transferred to the delivery department "," Delivered ", which we added at the time of creating the web form and hid from customers).


Moving on to editing actions. Where you need to specify a field from the drop-down list, select the "Telephone for communication" field.


In the template for SMS, enter the following message:


Hello | Name |
The status of your order is changed to | Order Status |.


That's all, in just a couple of minutes we set up 2 actions according to the condition.


For those who wish to test the resulting module personally, leave a link to the newly configured form: tynts .


And look at the material that represents the MTH as a whole, it is possible in this habratopic .


')

Source: https://habr.com/ru/post/324216/


All Articles