# Referral system

Say no in a boring and standard way of inviting participants to your chat!

Referral system is an unusual and beautiful way to invite participants to a chat. And it is also a motivation that encourages new users for joining the chat, as well as those who invite them to join it.

The referral system is a unique "invitation link" for entering the chat, which is created individually for each chat participant.

# Создание реферальной ссылки

The first and most important question is: "Where can I get a referral link to participants if they are denied access to the standard section in the group management "Invitation links?". Everything is very simple here. Participants will receive a referral link by calling a trigger, in the content of which it will be located.

The simplest example of how to make a trigger to create a referral link is shown in the screenshot below.

The referral link is created by the placeholder %chat_ref_link%. Put it in the "Message" field and add the necessary text.

The trigger call condition and the message texts can be set at your discretion.

This is how a chat message will look like according to our settings.

How does a referral link differ from a regular chat link, and what is its uniqueness?

The answer to this question lies in the user's click on this link.

  1. Referral link leads directly to your bot
  2. The user is greeted with a message that you can customize yourself.

To set up the first message that a new participant will see, go to the section **"Referral system" ** and find the block "Message in the BOS after clicking on the referral link". This is the message that a new participant will see by clicking on the referral link.

You can include in the message an attractive description of the group that the participant will join, or announce in it the rules of communication in the chat.

Placeholder %actor_username% will output the name of the invitee Placeholder %username% will display the name of the invitee Placeholder %join_chat_link% will display a link to the chat itself

An example of a message that a participant will receive in a personal dialog with a bot after calling the /start command.

# Триггер для начисления очков действия

Next, consider a case with the insertion of a trigger that will work after a new participant joins the chat.

Here you can set up the issuance of ** Reputation**, ** Experience Points** and Action points for the user who invited a new participant, for the invited one himself, as well as add an individual form to fill out, etc.

As an example, let's create a trigger for awarding Action Points to someone who invited a new participant.

Go to the settings of the trigger itself. Create a new trigger in the "Chat Triggers" section, we put absolutely any parameter from the list in the "Conditions" for calling the trigger, since it does not play a role (the trigger call will be the participant's entry into the chat). In the actions, select "Increase or decrease the number of user action points."

In the same action block, you need to specify "Who is covered by the action":

Trigger initiator - the one who joined the chat via a referral link.

** Who was answered ** - the one who invited by referral link.

Who was answered and the initiator of the trigger - who joined the chat via a referral link and who invited to the chat via a referral link.

If you select "To whom you answered", then the points will go to the one who invited a new participant to the chat via a referral link.

Now, when a new participant enters the chat, the one who invited him will be awarded Action Points. In order for the trigger to notify in the chat that the reward was awarded to the invitee, we add the action "Send a message to the chat."

Placeholder %actor_parent% - the one who came to the chat via a referral link. Placeholder %target_parent% - the one who invited by referral link.

If there is a user check in the chat, it can be disabled for those who come by referral link.

It is also possible to connect the button "Add participants" and then the referral system will act on those who were added to the chat using the button.