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!