Forward Gmail to Telegram VS AI/App Script/Make.com
Would be great to run Google Apps script from Make scenario automatically. Here’s how it’s possible.
I need to get notifications on Telegram when an important client writes to me. Looks simple, so I’ve decided to use AI to code.
Afterwards, the task of sending a message from Gmail to Telegram turned into this:
- Easy. Fetch unread Google Mail with search request:
from:target@domain.com
- Hard. Check from memory if the task was already sent to Telegram. We must have a memory processor to store tasks done, delete old info to clear memory, and add new tasks. That’s a lot of work
- Tricky. Convert message from email to proper Telegram format. Here is the place where AI failed.
- Easy. Send a message to Telegram
Part 1. Developer VS AI
After a few rounds of chatting and testing, I gave up. Open AI could not help me, but confused instead. It invented its methods. It produced code with new errors.
The end of part 1.
Part 2. Developer VS code
I’ve made my App Script solution. It worked fine, and it took 2 hours to do. I’ve used my store object from other projects, so the hard part was done fast.
Set up a trigger. Got a working solution. Happy.
Drawbacks:
- Spent time connecting the store
- Getting casual errors from trigger:
We're sorry, a server error occurred. Please wait a bit and try again
. Errors like that usually mean temporary issues on Google servers. You’ll get an email notification with this error, which is annoying. But the automation still works.
Part 3. Developer VS Make
I’ve decided to use Make as it is one of the hot topics now.
My first impression was bad. Each extra step turned into an error:
After trying a bit I gave up.
Part 4. Developer VS Make. Round 2
Make was bad in tricky part:
- Convert message from email to proper Telegram format. Here is the place where AI failed. And Make failed…
Make could not convert text from email into proper Telegram format. It was fine with short messages. I needed a code for that.
The solution was unexpectedly simple, yet powerful. We use the HTTP POST request here. It posts data from the Gmail body to our App Script. Apps Script will return anything we want. The task is done!
Made a WebApp for that. Sample Web App code is here:
After a setup, I was able to reduce the amount of code dramatically:
- No Gmail part
- No Telegram part
- Absolute winner — no store and engine to control duplicates
Make covers all 3. My code became ~7 times shorter! And I had to include logic only, no engines, connections, etc. It was pure JavaScript on my side.
Conclusion
As a business owner, any of us is considering value VS cost. Make has a price per automation module. My sample automation includes 3 modules, and each 15 minutes it takes 3 credits. It is almost 10K credits per month. Good appetite!
On the other hand, the development price decreases with no-code solutions. Lots of automation does not require coding. For me, as a developer freelancer, it is beneficial to know both sides:
- no-code (Make, etc.)
- almost code (App Script)
And even this:
- code (Node JS and cloud functions)
Need a professional help? Book an appointment:
https://calendar.app.google/WnkZdXTaH9GhozFw8