Skip to content

The moment it happens

Send e-books to your Kindle from Telegram

Forward an e-book to your Telegram bot and it arrives on your Kindle a few minutes later.

Runs
The moment it happens
Apps
Outlook, Telegram
AI
Not needed
Access
Mail.Send; bot token

Send this to your assistant

Create a ClickRuntime automation: when I send a file to my Telegram bot, email it from my Outlook to my Kindle address and reply in Telegram when it's sent.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Getting a document onto a Kindle usually means finding the file on a computer, opening email, attaching it and remembering the Kindle address. On a phone, that's fiddly enough that articles and books pile up unread.

Sharing the file to a Telegram bot takes two taps from any app. The email to Amazon is sent from your approved Outlook address, so the file appears in your library without you touching a computer.

What you get out of it

  • Two taps from your phone

    Share a file to the bot from your downloads or another chat. There's no email to write and no address to remember.

  • Uses your approved address

    Amazon only accepts documents from addresses you've approved. Sending from your own Outlook keeps it on that list.

  • Confirmation in the chat

    The bot replies once the email has gone, so you know the file is on its way. If something fails, you hear that too.

  • Works for anything Kindle reads

    EPUB, PDF and Word files all work. Reading material from colleagues or newsletters goes to the same place.

How it works

What happens, step by step

  1. You send or share a file to your Telegram bot.

  2. It checks the message came from you and has a file attached.

  3. The file is downloaded and emailed from your Outlook address to your Kindle address.

  4. The bot replies in the chat to confirm it was sent.

Before it runs live

  • Connect Outlook
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Send e-books to your Kindle from Telegramjust nowSucceeded
Telegram · Kindle botSent field-guide-to-pricing.epub to your Kindle

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Outlook and Telegram steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
send_files_to_kindle_from_a_telegram_bot.pyexample
GRAPH = "https://graph.microsoft.com/v1.0"
TG = "https://api.telegram.org"
import base64
from clickruntime import on_event, credentials, http

MY_CHAT_ID = 123456789
KINDLE = "yourname@kindle.com"

@on_event
def handle(event):
    msg = (event.json or {}).get("message", {})
    doc = msg.get("document")
    if msg.get("chat", {}).get("id") != MY_CHAT_ID or not doc:
        return {"skipped": True}
    bot = f"{TG}/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}"
    path = http.get(f"{bot}/getFile", params={"file_id": doc["file_id"]}).json()["result"]["file_path"]
    data = http.get(f"{TG}/file/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{path}").content
    att = {"@odata.type": "#microsoft.graph.fileAttachment", "name": doc["file_name"], "contentBytes": base64.b64encode(data).decode()}
    mail = {"message": {"subject": doc["file_name"], "body": {"contentType": "Text", "content": "Sent via Telegram"},
                        "toRecipients": [{"emailAddress": {"address": KINDLE}}], "attachments": [att]}}
    h = {"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}
    http.post(f"{GRAPH}/me/sendMail", headers=h, json=mail).raise_for_status()
    http.post(f"{bot}/sendMessage", json={"chat_id": MY_CHAT_ID, "text": f"Sent {doc['file_name']} to your Kindle"})
    return {"sent": doc["file_name"]}

FAQ

Common questions

Which file types work?
Anything Amazon's Send to Kindle accepts, including EPUB, PDF, DOCX and TXT.
Is there a file size limit?
Telegram bots can download files up to 20 MB, and Outlook attachments are limited to about 3 MB with this method, so very large books are better sent another way.
Can other people use my bot?
No. Files are only forwarded from the Telegram chat ID you set, and anything from other chats is ignored.
What permissions does it need?
Mail.Send; bot token. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Send e-books to your Kindle from Telegram” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.