Gmail logo
Google Drive logo
Telegram Bot logo

Workflow template

Gmail attachments to Drive and Telegram

Upload new Gmail attachments to sender/date folders in Google Drive, make each file readable by anyone with its link, then send that link to Telegram. Review both the sharing permission and chat destination before activation.

How it works

From an email attachment to a public Drive link in Telegram

1 Trigger · 4 Actions
Gmail1 · Trigger

New Attachment Received

Poll received Inbox messages and emit one event per non-inline attachment. Eligible attachments waiting in a backlog continue across later runs.

Google Drive2 · Action

Create sender/date folder

Find or create fasthook_public_attachments/{sender folder}/{received date} using the Gmail trigger’s sender and date values.

Google Drive3 · Action

Upload attachment

Upload the trigger’s File to the returned sender/date folder and retain the uploaded file’s webViewLink for the final message.

Google Drive4 · Action

Make attachment public

Grant anyone reader access to the uploaded file. This makes it readable to anyone who obtains its link, including people outside the Telegram chat.

Telegram Bot5 · Action

Send public link to Telegram

Send the uploaded file’s Drive webViewLink as the entire message to your chosen Chat Id. The prepared message contains no email subject, sender summary or binary attachment.

The result

A shared Drive file and its link in your chat

Each successful attachment event uploads a file, grants public-link reader access and sends the uploaded file’s viewing URL to Telegram.

Illustrative Telegram message

https://drive.google.com/file/d/FICTIONAL_FILE_ID/view

Fictional URL. The file sits under fasthook_public_attachments/{sender}/{received date}. Its access is not limited to chat members: anyone who obtains the link can read it.

Before activation

Set up your workflow

  1. Select which Gmail attachments to process

    Connect the receiving Gmail mailbox and review search and label filters. One event is emitted for each non-inline Inbox attachment, so a message can produce several uploads and Telegram messages.

  2. Review the public-file permission

    Connect Drive for the folder, upload and sharing steps. Review the fasthook_public_attachments path and anyone/reader permission. Change the sharing design before activation if these files should remain private; changing only the Telegram chat does not restrict file access.

  3. Choose Telegram and test with fictional content

    Connect the FastHook Telegram bot and select a Chat Id where it can post. Activate after reviewing sharing, then send a fictional attachment and check its Drive permission and the link-only Telegram message after polling.

Details and limitations
  • The link can be read outside Telegram. The workflow explicitly grants anyone reader access. A private chat or folder does not narrow that file permission. Anyone receiving or forwarding the link can read the shared file, subject to the permission being allowed by Drive policy.

  • The prepared destination message is only a URL. Telegram receives the upload’s webViewLink, not the file bytes, subject, sender or a formatted summary. Review that field if you want a different message.

  • Later failures do not reverse earlier file actions. If sharing fails, an upload can remain. If Telegram fails after sharing, the file can already be publicly readable. The recipe has no rollback, existing-file lookup or automatic permission-revocation step.

  • One attachment per event. Inline images are excluded. Multiple eligible attachments can produce several files and chat messages, and pending backlogs can continue across polls. Manual reruns can upload and announce another copy.

Questions about this template

Can only members of my Telegram chat read the file?

No. The prepared Drive action grants anyone with the link reader access. Chat membership does not restrict the file permission. Review sharing before activation.

Does the bot send the attachment itself or an email summary?

Neither is prepared. It sends only the uploaded Drive file’s webViewLink as the message text.

Where are attachments stored?

Under fasthook_public_attachments/{sender folder}/{received date} in Drive. The folder action reuses an existing path or creates missing folders before upload.

What if Telegram fails after the file has been shared?

The upload and sharing have already happened and can remain in place. The recipe does not revoke permissions or delete the file when the later Telegram step fails.