How to Build a Telegram Bot to Send Personalized Offers to Customers

Messaging apps like Telegram are an inventive way to reach your audience. Learn how to build a bot that automatically sends branded promotional offer graphics to specific user groups.
by Julianne Youngberg ·

Contents

    Telegram is a simple, fast, and secure messaging app known for its robust features for both individual and business use. Unlike social sharing platforms like Facebook, Instagram, and Twitter, messaging apps enable reaching out directly to customers and are typically used further down the marketing funnel.

    As the third most downloaded messenger app worldwide, Telegram gives you access to a large audience and can serve as an additional platform for connecting with customers. You can use it for something as simple as text-based reminders, but Telegram also offers features like custom bots, community channels, and integrated payment capabilities, which can enhance users’ experiences on the app.

    Telegram Bots are a method you can use to deliver personalized offers to customers. And aside from being completely customizable and automated, the workflow is fairly easy to set up without any code. This article will go over Telegram’s Bot features and how you can create a simple automation that generates images with an offer’s details, then sends them to customers via bot.

    What Are Telegram Bots

    Telegram Bots are small applications that operate using Telegram messages as an interface. They are unique accounts that don’t require a phone number for setup. Bots can join groups and channels to engage with users, and they respond according to their build instructions. Built with Telegram’s Bot API, they serve various functions such as:

    • Sending messages to individuals, groups, and channels
    • Receiving payments for transactions
    • Integrating with other services to build custom tools

    While many of these apps require coding, there are some simple uses you can absolutely fulfill using only nocode tools.

    What You Will Create

    A Telegram Bot can be used to automatically send promotional offer graphics to individual users, groups, or channels. And instead of having to design graphics and prepare messages individually, we can use nocode tools to automate the process.

    The tools you’ll need are:

    • Airtable : To store promotional offer details and generated image links
    • Bannerbear : To generate graphics based on dynamic templates
    • Telegram : To send promotional offers to customers
    • Zapier : To coordinate automated events in different programs

    By the end of the tutorial, you should be able to send messages with linked offer graphics to customers that look like this:

    Sample promotional graphic generated with Bannerbear

    Let’s get started!

    How to Build a Telegram Promo Bot Without Code

    We’ll use a few nocode tools and Telegram’s Zapier integration to generate a graphic with offer details, then send them to selected customers. Here’s a step-by-step guide:

    Step 1 - Create a Telegram Bot

    Telegram Bots are special accounts that don’t need to be tied to a phone number, but you do need an existing personal or business account to set one up. From there, you can use @Botfather—Telegram’s tool for creating and managing bots—to create a bot account.

    Log into the Telegram app and go to the Contacts tab. Click the + symbol to add a new contact.

    Mobile screenshot of Telegram contact page

    Insert @Botfather into the search bar, then add the verified account as a friend.

    Mobile screenshot of Telegram contact page with @Botfather outlined in red

    A new chat conversation will now appear, introducing @Botfather. You can insert /start to see what the tool can do.

    Mobile screenshot of Botfather start chat

    Enter /newbot to create a new bot. You’ll be instructed to choose a name and username.

    You’ll also be given an API token which you can use to integrate your bot with other services. Save this in a secure location—we’ll use it later.

    Mobile screenshot of Botfather new bot chat interaction

    You can also customize your bot’s description, about, and profile picture at this stage.

    Bear Tip 🐻: Learn more about customizing your Telegram Bot using @Botfather in this tutorial.

    In this example, promotional offers will be sent to a channel, so the bot must be added as an administrator. The same step applies for groups, but it can be skipped if you’ll be sending messages to individuals (where user ID can be used).

    Create a new channel (or open the chat for an existing one), and customize it as desired.

    Mobile screenshot of sample channel

    Tap the channel profile button to open settings, then select Administrators. Add your new bot as an admin.

    Mobile screenshot of channel admin panel

    Your bot should now be able to send messages in the channel.

    Step 2 - Populate an Airtable Base with Offer Details

    Airtable is a cloud spreadsheet-database hybrid that we’ll use to store our promotional offer details. Log into your account, then create a new base (or open an existing one you use for campaign details). You’ll need fields for the following:

    • Offer Headline
    • Offer Details
    • Offer Amount
    • Campaign Photo
    • Promo Code
    • Ready? (to indicate when a campaign’s details are ready for image generation)

    Some optional fields that can be helpful are:

    • Campaign Title
    • Category
    • Qualified Leads
    • Notes

    These can all come together to create a table that looks like this:

    Screenshot of Airtable sample base

    If you’ll be sending messages to individual users, consider creating an additional table for leads, then using a rollup field to link qualified leads to each campaign.

    Screenshot of Airtable rollup field outlined in red

    You’ll also need to add a view that filters for campaigns that are ready for image generation. This view will act as your workflow trigger.

    Click the + icon next to Grid on the left sidebar. Add a filter: Where Ready? is ✅ (checked).

    Screenshot of Airtable filters with ready outlined in red

    Ensure you have at least one sample data record with the "Ready" column checked for testing the automation.

    A great way to add more variety to your offer graphics is to incorporate additional views for different campaign types, then filter for them separately. Each view can be a separate trigger that activates image generation based on a different template.

    Step 3 - Design a Bannerbear Template

    Bannerbear dynamically generates images based on templates you design, streamlining repetitive workflows and minimizing manual work.

    Log into your Bannerbear account (or get started for free! 🎉) to create designs. Click the Projects tab, then create a new project. You can get started on a design from scratch or with one of our templates:

    Bannerbear White Grey E-commerce Simple Price Graphic template

    Customize the template however you’d like, ensuring you have dynamic fields set up for each item that involves unique data.

    Use static fields for items that will remain the same (such as your brand’s logo).

    Screenshot of Bannerbear editor

    When you’re happy with your design, click Save Template.

    Step 4 - Set Up a Zap to Send Graphics to Telegram Users

    A three-step zap will fetch offer details from Airtable, use it to generate a graphic, then send a message to your Telegram channel.

    Log into your Zapier account and click + Create Zap. Set up the following events:

    Trigger: New Record in Airtable

    Choose Airtable as the app and New Record as the event. If you haven’t connected your account, you will be prompted to do so using a personal access token, which you can set up from Airtable’s Developer Hub.

    Set up the trigger by selecting the correct, base, table, and view.

    Screenshot of Zapier Airtable new record trigger

    Test the trigger to ensure Zapier is able to find a record.

    Action: Create Image in Bannerbear

    Choose Bannerbear as the app and Create Image as the event. You will need to connect your account using the key found by clicking the Settings / API Key button of the corresponding project of the Bannerbear app.

    To set up the action, choose your template and map all of the offer details to their corresponding dynamic fields.

    Screenshot of Zapier Bannerbear create image action

    Test the action.

    Bear Tip 🐻: If you’d like to save the generated image to your base, add the dynamic Airtable ID field as metadata in this step, then add an additional step that updates the record with the image link.

    Action: Send Message in Telegram

    Choose Telegram as the app and Send Message as the event. Connect your account using the API token from earlier in this tutorial.

    Set up the event by selecting the channel’s chat ID and adding message text that includes your generated image link. If you’d prefer to draft the text in Airtable, you can also do so and simply link to the field here.

    Screenshot of Zapier Telegram send message action

    Keep in mind that Telegram’s Zapier integration supports plain text, HTML, and markdown formats. While you can attach an image using code or a SendPhoto request, these options are more technical and time-intensive. Sending an image as a link will still display a preview and may still be the simplest option for this use case.

    Upon testing the action, you should see the message sent to your channel, along with a preview of your generated image:

    Mobile screenshot of Telegram channel with automated bot message

    Bear Tip 🐻: Add an additional URL Shortener Zapier step after image generation if you'd prefer not to use a direct Bannerbear link.

    Reaching Customers Via Messaging Channels

    Thoughtful marketing is all about reaching your audience at the right place and time. And if Telegram happens to be the right place, using it to deliver beautiful promotional graphics is only the start.

    Some ways you can take this workflow even further are:

    • Sending coupons with QR codes exclusive to specific users or products
    • Notifying customers when new products are released
    • Sending personalized community welcome graphics
    • Generating images in response to chat interactions

    While you can certainly build a more feature-rich bot with code, sometimes a few nocode tools is all you need to reach users in a creative way. Give it a try!

    About the authorJulianne Youngberg@paradoxicaljul
    Julianne is a technical content specialist fascinated with digital tools and how they can optimize our lives. She enjoys bridging product-user gaps using the power of words.

    Bannerbear Beginner Guide: How to Start Generating Images Dynamically in JavaScript with Bannerbear

    If you want to integrate dynamic image generation into your JavaScript project, this article is for you! Learn how to do it effortlessly with Bannerbear—we’ll walk you through the entire process, from setup and implementation to achieving the final result.

    How to Instantly Generate Certificates Online with Bannerbear and Airtable

    One way to generate a large batch of certificates on-demand is with a direct Airtable integration. Here's how to connect your base to Bannerbear and generate dozens of graphics in seconds!

    How to Automatically Create Eye-Catching Images for Your App's Link Sharing Using Bannerbear (Node.js)

    Want to make your app’s link sharing stand out? Learn how to use Bannerbear to automatically create eye-catching images that boost click-through rates! This tutorial walks you through building a backend service with Node.js to automatically generate custom images based on dynamic data.

    Automate & Scale
    Your Marketing

    Bannerbear helps you auto-generate social media visuals, banners and more with our API and nocode integrations

    How to Build a Telegram Bot to Send Personalized Offers to Customers
    How to Build a Telegram Bot to Send Personalized Offers to Customers