Documentation for v.1.0.0

Last updated: Feb 17th, 2025

About the Plugin

The main feature of this plugin is to let your customers register and login to your site via your Telegram bot.

This process has the fastest workflow, because user only need to click "start" once after his redirection to your bot. All next login actions will be even faster, because that will not be necessary to click "start" in the bot chat again.

The user just needs to have Telegram app installed on its device.

That way to login or register might be helpful if you want users not to share their credentials to your site with others. For example, if you provide online-courses or other intellectual information on your site.

The plugin doesn't send any user data to 3rd party. All data is only transferred between your site and your telegram bot.

Plugin thumbnail

Get the plugin

Installation

Download the zip file of the plugin from the repository. After go to the admin part of your site to the Plugins - Add New page.

To open the file uploading form click the Upload Plugin button on the top.

Installation

After select the downloaded zip file in the form lower, submit it and click Activate button.

The next you might need to check is the plugin settings.

General Settings

To start to work with the plugin, you need to have a Telegram bot. That's possible to create a new one or use an existing.

You can find the complete manual about this in the official Telegram docs.

In a few words, that's only necessary to enter a service name, similar name ending with "bot" and get an API token as a result. After, you can change bot data to change its avatar or description.

Then your bot is ready, save its ID and token in the special plugin settings.

Important! Please, keep in mind, your bot webhook will be changed to the plugin request's listener URL. So if you use this bot for any other webhook operations, this process might be broke.

This is possible to prevent the webhook URL change via custom code, but you'll need to add the plugin requests listener and handler to this URL also.

There are a few predefined views of the auth link itself and its icon before the text. You can see how it will look in a small preview, lower the link view setting.

That's also possible to disable all built-in views and styles. Select "None" value for both settings, and then just style .wptgauth-link element using your custom CSS.

To output the link, use the [telegram_auth_link] shortcode. Set the link text you need between the opening and closing tags of the shortcode. You can pass extra link attributes by the shortcode attributes.

For example:
[telegram_auth_link title="Login via Telegram" style="margin: 1rem;"]Login here[/telegram_auth_link]

To not output the login link for logged-in users, use the special setting. It allows to output nothing, default WordPress string, like "Howdy, USERNAME", or custom HTML.

Custom HTML setting supports all registered shortcodes. Also, it has a few dynamic variables to be replaced by the actual user data, such as [user_first_name] or [user_avatar_url]. There is also a [logout_url] variable available to make possible to logout by click.

[user_avatar_url] shortcode can have inline attributes supported by the native WP function.

General settings page

Messages Settings

There are settings available to change all messages your bot will use while getting user commands.

The user will get these messages right in the Telegram app chatting with your bot.

Messages settings page

WooCommerce Settings

The plugin allows to be integrated with WooCommerce.

This is possible to replace the default WooCommerce login form by the custom HTML with login via Telegram link. You can change this HTML content using the setting lower.

You can disable "Edit account" and "Reset password" pages at all to not let users change account password and share their credentials with others. So there will be the only way to login on your site via Telegram account which will hardly be shared with someone.

Another good feature is a possibility to get guest orders, but register a user and bind this order to him on the "Thank you" page via instant Telegram auth. This could make the purchase process faster and increase the conversion. If the user is already logged-in while ordering, with process will not be necessary and launched.

Add a message at the "Thank you" page with the [telegram_order_bind_link] shortcode to let guest user to create a user and bind the order. Place link text between the opening and closing tags of the shortcode.

That's also possible to add a message to the user order email to not forget to bind this order to his account. There is a special [order_received_url] shortcode available to output the order "Thank you" page URL.

If user clicks this link twice nothing will be changed. He only will be logged-in on the site.

If order is already bind to another user, there will be an error message about it.

WooCommerce settings page