Selling courses in a chatbot

Read the article and find out how to set up a bot to accept payments for online courses.

Setting up online course sales in chatbot is an innovative approach that significantly reduces the time and labor costs of customer service. Using a chatbot, you can automate transactions in real time.

In addition, you can set up data collection in the chatbot for further instant user registration.

In this article, we will look at the process of setting up course sales in the chatbot:

  1. Which payment systems are available in the courses;

  2. Step-by-step setup of a chatbot to collect data and issue a payment link.

  3. Email registration for the course via the bot

Choosing a payment system

Unlike course payments on the promo page, you can select any payment system you need, which is enabled in your project in the "Payment systems" section:

There are a lot of integrations with payment systems in Mavibot:

Each payment system has its own connection features, the description and detailed instructions of which are available in the Mavibot documentation.

To find an article on the selected payment system:

а) or go to the "Integration" section of the documentation -> "Payment systems", ссылкаПлатежные системы", then select the article on connecting the payment service:

б) or, click on "connect" on the service bar in the "Payment systems" section in the project settings:

After clicking on the required button, a modal form window opens, where there is already a link to an article with your chosen payment system:

After connecting the payment service, go to the course settings.

Creating an online course involves your personal expenditure of resources on structuring information, its design, presentation, as well as other technical settings.

To receive the necessary and commensurate payment for your knowledge from students, there is a setting of pricin plans and payment acceptance both on the course page and via the chatbot.

circle-info

How to accept payments for online courses on the promo page, read the article of the same name.

circle-info

To further configure payment acceptance in the chatbot, you need to set up pricing plans, since the calculator uses the pricing plan ID in the block settings.

To learn how to set up pricing plans, read the article of the same name. ссылка в одноименной статье.

Pricing plan ID

To use payment based on the course pricing plans, you need to find the pricing plan ID (or pricing plans) that will be used in the payment function in the block settings in the funnel constructor.

To do this, go to the "Pricing plan" tab by clicking on the corresponding button on the course card in the section with the same name.

Then you will go to the "Pricing plans" section in the course settings:

Pricin plan ID is quite easy to find: it is already visible on the card in the section:

Click on the pricing plan ID, then it will be copied to the clipboard and in the future you can use it for payment function:

At this stage, the configuration in the "Courses" section is completed. Go to the configuration of the scheme in the funnel constructor.

Blocks in the funnel constructor

After completing the necessary settings in the online course, go to the funnel constructor, where you will create a scheme for the chatbot.

The scheme will consist of blocks that are responsible for:

  1. Data collection: name, email;

  2. User's choice of a pricing plan to enroll in the course;

  3. Creating a payment link;

  4. Register by email for the online course after payment.

Data collection blocks

The entry-level blocks will be used to collect your client's data: name and email address, which will be needed for further registration of the user for the course.

Step 1. Create a block of primary verification of the condition, in which we prescribe any necessary message to greet the user:

You will need this block to start the chatbot scheme, which is responsible for selling and enrolling in an online course.

Step 2. Create the following block that tells the user about the available pricing plans:

We write a message with the content of the pricing plan and also ask the client about his interest.

Step 3. Create data collection blocks:

This block requests an email from the user, which we will later use the arrow to write to a variable.

Step 4. Create an arrow to collect data:

In the arrow settings, activate the "User enters data" checkbox and set the variable with the email name.

Also, in the block condition, we put a regular expression for checking email:

This will help the bot to record the email of the accepted sample, rather than a random set of characters or letters.

If necessary, you can create a "Not state" block from this block, which will respond to the user that the email does not correspond to reality:

You cannot switch to the "Not in state" block, so further movement along the funnel will go exactly after the user enters the email address down the funnel.

The regular expression used to check email looks like this:

^[-\w.]+@([A-z0-9][-A-z0-9]+.)+[A-z]{2,4}$

circle-info

The entire list of useful regular expressions and their applications can be found in the article "List of useful regular expressions". ссылка Список полезных регулярных выражений".

Step 5. Create a block in which the bot asks the client for his name:

Step 6. From the same block, create an arrow in the settings of which we indicate that the user enters data and save the entered data to a variable (similar to the email variable):

At this stage, the creation and configuration of data collection units is completed.

Pricing plan selection blocks

Step 1. In the block, we write a message for the user, which pricing plan he wants to choose:

Step 2. In the same block, we use the calculator to indicate the available pricing plans in the course:

Instead of the #{pricing plan ID} construct, specify the pricing plan ID in the calculator that exists in your project:

Step 3. Create buttons in the arrow to select the pricing plan.

To do this, we pull two arrows from the calculator block:

Next, enter the pricing plan name in the arrow settings:

And it is also necessary to activate the "Display as a button" checkbox so that the client, for example, does not manually enter the pricing plan name and simply clicks on the button:

Пример клавиатурных кнопок

After your user selects a pricing plan, you need to create a payment link.

Step 1. Create a block in which we create a variable with a link to the payment:

circle-info

For each payment system that you use to generate a payment link, there is a separate function for generating a link. For example, we used the LifePay payment system.

In the calculator, we specify the amount you set in the pricing plan, where instead of the construction #{pricing plan amount}, you need to specify YOUR payment amount according to the pricing plan on the course:

Step 2. Create a payment button in the block:

Click on the "Add" button, and then the modal form window will open:

Where in the URL field you need to specify a variable using the #{} construction, which contains your payment link:

Переменная в конструкции #{} для направления ссылки на оплату
Переменная, в которой лежит ссылка на оплату

If you have done everything correctly, then the payment page will open for you during testing:

The payment page during clicking the button:

Student registration for the course after payment

After successful payment, a system callback message is received in the dialogue with the client:

The callback consists of the first ten characters of the secret key, the payment status (success or false), and the payment amount.

circle-info

The callback is not visible in the dialog with the client, it is a system message.

After the client pays for your course, you can configure the bot's response to the callback and enroll the student in the course.

Step 1. Create a block of primary verification of the condition, in the condition of which we insert a payment callback:

This block does not need to be connected by arrows to others, it will work itself out after the callback arrives in a dialogue with the client.

Step 2. In the calculator, we prescribe the function of registering a student for a course - register_customer_on_course():

Where instead of the #{Pricing plan ID} structure, you need to pass the ID of your pricing plan, at the cost of which the payment was made:

  1. The pricing plan ID in the tariff card:

  1. The pricing plan ID in the registration function for the course:

Function and parameters:

register_customer_on_course(tariff_id, email, email_notification, period, reregistration, purchase_price)

Parsmeters
Paremeters decription

! tariff_id

required parameter, the ID of the pricing plan ID. You can copy it in the browser line in the pricing plan settings.

! email

required parameter, the client's email address. You can specify a specific value or variable in which the client's email is recorded.

email_notification

optional parameter, sends the student an email message about his registration for the course, if it is enabled.

period

optional parameter, time limit for the validity of the pricing plan. Date formats are supported as follows: %d.%m.%Y %H:%M или %d.%m.%Y Example:

period = '15.08.2023 11:00'

reregistration

optional parameter, with values True or False. This parameter is optional and is specified if you need to register students again for the same course and pricing plan.

purchase_price

optional parameter. Allows you to specify the cost of the course if the client paid for access to it through a bot. If you do not specify it, the cost of the specified pricing plan will be used. It will be useful if the client pays for access to the course through the bot at a different price than the cost of the specified pricing plan.

circle-info

In order for clients to receive emails, pass 1 in email_notification parameter.

If you do not send 1, then the client's emails will not be received!

circle-info

All available functions for the course can be found in the article "Calculator functions for courses". ссылка Функции калькулятора для курсов".

Result

The final scheme in the funnel constructor for selling a course via a chatbot looks like this:

The scheme is quite small, but it performs the following important functions:

  1. It tells the client about the available pricing plans on the course;

  2. Collects data in the form of name and email;

  3. Allows the client to choose the pricing plan he needs;

  4. Generates a link to the payment after selecting the pricing plan;

  5. Registers your client based on the collected data in the form of an email for a course at a certain pricing plan;

  6. Using the registration function for the course, he sends a letter of registration to the student.

Last updated