Automate notification emails with Tadabase
Hello everyone, this is Tim from Tadabase, and in today's Build It with Tim episode, we'll explore how to automate your notification emails using Tadabase.
The goal of this tutorial is to set up an automated system to send notifications based on the fulfill by date of orders in your application. When the fulfill by date is three days away, we want to send a notification to ensure no orders or fulfillments are missed.
To achieve this, we will follow four simple steps and utilize three key features in Tadabase: Table Rules, Tadabase Pipes, and Scheduled Tasks.
Step 1: We'll start by adding a new date field in our data table to store the notification date we'll use later in the workflow. Simply go to the "Fields" tab, select the date category, and create a new date field titled "notification date."
Step 2: Next, we'll install the Tadabase Date Utilities Pipe. This powerful pipe offers various utility functions for handling dates, but for our purpose, we'll focus on the "subtract days" function. Once installed, we'll set the time zone to match our application.
Step 3: Creating and running a Table Rule is our next step. This rule will trigger every time a record is created or edited. Within the rule, we'll add the Tadabase Date Utilities Pipe and use the "subtract days" function. We'll pass two parameters to the pipe: the original fulfill by date and the number of days to subtract (in this case, three). Finally, we'll set the value of the "notification date" field to the pipe response.
Step 4: The last step involves setting up the automation through Scheduled Tasks. We'll create a task named "Send Fulfillment Notification" and configure it to run on the "purchase orders" data table. This task will process every record in the table. We can schedule the task to run every day at a specific time, such as 9:00 AM, for example.
For the action, we'll choose to send an email, which will be our notification. A crucial step is to add a condition: we'll use the "notification date" field as a condition to check if today's date matches the notification date. If the condition is met, the email will be sent.
To provide more context in the email, we can add field values, such as the purchase order ID and the fulfillment date. This way, the notification will contain essential information for administrators or warehouse managers responsible for fulfilling the orders.
Optionally, we can add additional conditions, like the "order status," to further refine which notifications get sent. For example, we might want to send notifications only for orders that haven't been prepared yet.
That's it! By following these four steps and leveraging Table Rules, Tadabase Pipes, and Scheduled Tasks, you can easily automate notification emails based on the fulfill by date of your orders, ensuring a smooth and efficient fulfillment process in your application.
If you have any questions or need further assistance, don't hesitate to reach out to our support team. Happy automating with Tadabase!
Features Discussed:
-
Tadabase Date Utilities (Time: 02:00)
Learn how to install and configure the Tadabase Date Utilities Pipe, which includes powerful functions like "subtract days," "time ago," and "convert time." For example, learn how to set up a rule that subtracts days from a given date field using this pipe. -
Email Notifications (Time: 04:46)
Learn how to set up a scheduled task to send automated notifications. For example, you’ll learn how to configure the task to run daily at 9 AM, checking conditions like the notification date and order status before sending an email notification to relevant personnel, such as a warehouse manager, about upcoming order fulfillment deadlines.
Transcript Summary
Introduction
Hey everybody. In today's episode of Build It with Tadabase, we're going to learn how to automate your notifications.
Why Automate Notifications?
There are a number of reasons why you might want to automate notifications sent from your Tadabase application. Today, I'll talk about one specific example related to orders. We have orders that come into our application with an order date and a fulfill-by date. We want to send a notification based on the fulfill-by date. Specifically, when the fulfill-by date is three days away, we need to give someone a heads-up. We want to automate this so that no orders or fulfillments get missed.
The Process
The process is pretty simple—just four steps—and we'll rely on three major Tadabase features:
- Table Rules
- Tadabase Pipes
- Scheduled Tasks
Step 1: Setting Up the Data Table
First, let's look at the data table in our sample application. We're looking at our purchase orders table, which includes a "fulfill by date" field. Every order that comes in has a status and a date by which the order needs to be fulfilled.
We'll start by adding a new date field to store the actual notification date that we'll use later in this workflow. Go to the fields tab, select the date category, and add a new date field titled "notification date."
Step 2: Installing the Tadabase Date Utilities Pipe
Next, we'll install the Tadabase Date Utilities Pipe. You can find pipes under the pipe section of the Builder. If you don't see it, you can search for it and start the installation process.
The Tadabase Date Utilities Pipe is powerful and contains many utility functions for handling and managing dates, such as subtracting days, converting time, checking if a date is within a certain range, and more. For our purposes, we need the "subtract days" function.
Click the install button and enter any necessary configuration parameters, like the time zone, to ensure it matches the time zone of your application.
Step 3: Creating and Running a Table Rule
Now, we'll create a table rule that runs every time a record is created or edited. In the rules tab, add a new rule. By default, the rule will run every time a record is created or edited, which is what we want, especially if the fulfillment date changes after the record is created.
Within the rule, we'll select the date utilities pipe and choose the "subtract days" method. We need to pass two parameters to this pipe:
- The original date value, which comes from the "fulfill by date" field.
- The number of days to subtract, which we'll set to three in this example.
Finally, we'll set the value of the "notification date" field to the response from the pipe. Save the rule, then test it by editing any record to ensure that the "notification date" is populated correctly.
Step 4: Automating the Notification with Scheduled Tasks
Now that our data is set up, we'll automate the notification using scheduled tasks. Head to the automation tab, select scheduled tasks, and add a new task. Name the task "send fulfillment notification."
Select the data table for the task to process, which in our case is "purchase orders." The task will run on every single record in that table and perform an action. We'll schedule this task to run every day at 9 AM, which might be the start of the workday.
Next, configure the action to send an email, which will be our notification. Add a condition using the "notification date" field. The task will check if the notification date is today, and if so, it will send the email. You can configure the email to be sent to a specific administrator, warehouse manager, or someone responsible for logistics to ensure that the order is fulfilled by the specific date.
When writing the email, you can include field values to provide more context. For example:
- "Order [Purchase Order ID] is approaching the fulfill-by date."
You can also add other useful field values in the message.
Refining the Notification
To further refine which notifications get sent, we can use an additional condition, such as the order status. For instance, we'll only send notifications for orders that have not yet been prepared.
In this example, we'll add an additional condition to the task: "Order status is received." Now, every day at 9 AM, the task will check two conditions:
- Is the notification date today?
- Is the order status received?
If both conditions are met, the automated notification email will be sent.
Conclusion
That's the basics of setting up automated notifications in Tadabase. You can take it further by checking other pieces of data on the record that might be useful when sending out these notifications. Thanks for watching this episode of Build It with Tadabase!
We'd love to hear your feedback.