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.
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.
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.
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.
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.
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.
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.