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", 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 go to the “Payment” tab and select the connected payment provider.

Then you will go to the "Plans" section in the course settings.

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 the "Start" block. You can add any message in this block.

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.

Then create two blocks with connections.

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.

Then create a block bellow.

Step 4. Create an connection to collect data:

In the connection 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 (^[-\w.]+@([A-z0-9][-A-z0-9]+.)+[A-z]{2,4}$)

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 "Fallback" block from this block, which will respond to the user that the email does not correspond to reality.

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

The regular expression (regEx) 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. Write a message in the “Chat” block if the client entered their email correctly.

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

Pricing plan selection blocks

Step 1. Add buttons to the block with the names of the plans.

Step 2. Next, create two blocks: one that sends the client a payment button for the course, and another that provides access to the free course.

Step 3. Next, in the block with the payment button, add the message: “Please pay to get full access to the course.”

Student free registration for the course

Now let’s give the client access to the free course. To do this, go to the block connected to the “Free” path.

Then use the calculator function: register_customer_on_course(tariff_id, email, email_notification, period, reregistration, purchase_price)

  1. Enter the ID of the free plan,

  1. leave the email parameter unchanged,

  2. and set the email_notification parameter to 1.

You can skip the remaining parameters.

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 Start block, in the trigger of which we insert a payment callback:

This block does not need to be connected 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()

You need to pass the ID of your pricing plan, at the cost of which the payment was made.

The pricing plan ID in the tariff card.
The pricing plan ID in the tariff card.

Next, create a block below, set a timer for automatic message delivery, and add a message confirming that the student has been registered 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".

Last updated