Not only Gen Z, but also Millennials, and X-ers are almost without exception caught in the web, and no longer use paper mail (except for the Germans, I feel your pain, guys) – we all are counting on email. And while we can agree that we rarely write private emails, preferring to chat on iMessage, Messenger, or WhatsApp, in the business world emails still are pretty common.
One of the most widespread business email types is transactional – a form of non-duplex communication when a sender doesn’t expect an answer from the addressee. What are they in the case of the Retool Environment? Notifications, or, to be more specific, reports. In this article, we’ll focus mostly on them.
When to Send Reports
We send email reports from our Retool apps on two occasions: first is a situation when a user clicks, to say, a button in an app, while second is when a user (or a group of users) expects to get some data extracted from the system automatically on schedule.
What’s the point here? It’s unreasonable to make a user log in to Retool, navigate to an app, and then perform some actions (even if the action is limited to the button ‘Get Report’ click) if a user just wants to get an update on the current status. In this case, we built an app that manages an email list and a corresponding workflow that performs real actions on the schedule.
![A table with data](https://cdn.prod.website-files.com/5db1c0d5ca3871e8fd1a7b66/66ba06363b26ed0b8f33b909_668693d953e0f5f229f52ea1_Screenshot%25202024-07-04%2520at%252015.21.26.png)
Choosing an Emailing Service
Note: This part might be the most important, so try to read it carefully.
If you do not expect to send more than 120 emails an hour, and they are dedicated to your internal team only, I’ve got some good news for you. Retool has a built-in email resource, that is already preconfigured to be used across apps and workflows. But Retool Email has some limitations, too. Besides the 120 emails per hour limit, which drops down to 50 emails per day for the Free plan, there are more points to think about:
- the email address from which you will receive emails looks like email@your-company.retool-email.com,
- and you always get ‘Sent via Retool Email’ signature.
If you are okay with that, no problem.
![Retool signature](https://cdn.prod.website-files.com/5db1c0d5ca3871e8fd1a7b66/66ba06353b26ed0b8f33b8ef_6686952bbb0b9af184e6366d_970a6c6663fea4623602a3ed9a3fad0824efdd45.png)
If you are not, however, you might need to make additional steps to get emails flying out. You can send them using SMTP – in this case, Retool will act as a mail client. But just to note, if you are using Google Workspace, don’t even try to connect it this way! Google will drop support for all the ‘less secure apps’ in September 2024. However, you will still be able to interact with Google API using OAuth2.
![Google support](https://cdn.prod.website-files.com/5db1c0d5ca3871e8fd1a7b66/66ba06363b26ed0b8f33b906_668695b743faf78f097ce433_Screenshot%25202024-07-04%2520at%252015.29.20.png)
Or you can subscribe to a service like Sendgrid, or SendPulse, you name it. This is the first choice after Retool Email, in my opinion, and here’s why: in general, these services provide a templating system, that allows you to generate emails by just passing JSONs to the API endpoint.
Real-Life Example: Order Status Report
One of the clients for whom we are developing an app right now wants to be able to see some updates on Order Statuses every morning in their inbox. This report is intended to be received by the internal team, we expect not more than 31 emails a month (February will let us save even 2-3 emails, depending on the year), so we agreed to use Retool Email.
![Order report on schedule](https://cdn.prod.website-files.com/5db1c0d5ca3871e8fd1a7b66/668692dbeeb7f7bc7919611a_AD_4nXdgsKHuzOn5DYwcXKT-eUV6KTbGyYb8yyB9w6Z8SpZc_cxUJzUZlldo9ObNOl53zYpdij_UUkW0LS16ZqKQHiiMpbN-h_1HRHagHEO83TBvdsSnW3VbHMG5_wjRoOypCiZMeWZqn40tKlInJH-h9tkYL2Ik.png)
The logic behind this process is as follows:
- We get that one and only email to send the reports to from the DB table;
- We extract some data from the DB;
- Then we create a number of CSV files using JS;
- Finally, we sent an email with attachments.
![Email](https://cdn.prod.website-files.com/5db1c0d5ca3871e8fd1a7b66/668692da7fc452b60debf9e9_AD_4nXdLPK-d1aFWv5yNjinupzwWSe447jdWfL8eRnrLQEnRoGX3kvMb9xdjZiyJDyAJfkhK8s3MWqevzqO68P-uJnOiemHF3qfIFPMB8PX8ZacdgLMxwru69R4oUKbLAcVWQUGKBNGNWqezbWnkukp5XnZ2f7KP.png)
As you can see on the screenshot, Retool Email supports plain text, HTML, and Markdown. For this project, we decided to use a Markdown option, because it lets us get a simple formatting without spending too much time on it.
Okay, but what about schedules? I’ve been waiting for this question! To make these reports to be generated and sent automatically, we have to configure start triggers. In this case, we do not need a Retool webhook option to be enabled, but the schedule option. There you can specify an interval on which the workflow runs, or use a CRON-style notation to define a schedule. For our task a plain ‘sent at 6 am every day’ is enough, so we stopped on the ‘Interval’ option.
![Schedule set up](https://cdn.prod.website-files.com/5db1c0d5ca3871e8fd1a7b66/668692dacd54380be5ad36b9_AD_4nXd71O4EEOpxzCGjlHYYATIiKUIEIUdKol9D6j6kCh4Zmxoynb5GUV1X4Rh6Walqj_AxA43szo8RU-8EJZd4ndGsiQ7BUlcLbnnLUWhe59VsZzV-AiLF72gGE-VJWQdGlcxBdqKghAOtnZjbfPR7Hk2-yqRH.png)
One More Example to Wrap Up
I know you are already crafting your emails but wait a moment. I’ve got one more idea to share.
One of our clients wanted to secure themselves from a potential Retool outage (they use a cloud instance, to say). So we find a solution to facilitate this need using Retool Email.
Every night, a workflow runs. It gets all the project-associated table data as JSON strings and packs them into a single CSV file with two columns - table_name and table_data. Then this file is emailed to a backup address. Voila!
As you can see, email reports have dozens of potential use cases, so don’t limit yourself while working with them. And happy retooling!
---
Dmitry is the Head of Low-Code Department at Akveo. With a rich background in media and marketing, Dmitry brings an extraordinary look at the world of IT technologies. He is deeply passionate about finding the most effective and elegant solutions to complex client problems. In our blog articles, Dmitry will share his expertise in Retool and other low-code platforms to offer you valuable insights on Retool to enhance business process efficiency.
We already discusses with him how to use Retool Workflows, how to improve application security and how to schedule changes. More topics are coming. Stay tuned!
Get 17 the Most Essential Interview Questions & Answers
Submit your e-mail to get access.