tutorials
Back to overview

How to Automate Emails from a No-Code Database with n8n

Get the most out of your Baserow database

The best way to make the most out of your time is to use technology to automate as many tasks as possible. This is where email scheduling comes in. You can use automation to create a simple flow that sends notifications where and when you want them.

Automation tools make it easy for you to pass information across different apps without having to write a single line of code! With automation tools, Baserow users can connect their databases to over 5000 integrations and have access to different web services - all without coding.

Automating time-consuming and repetitive tasks has always been in our nature, whether it’s sending daily emails or posting updates to a Slack channel. It is more probable that attendees will keep appointments when emails are sent out to remind them.

What we will do

In this tutorial, we will set up a database, add rows to a view and schedule an email on a specific date. To automate with Baserow,

  • Add a date field to a table populated with details of job applicants
  • trigger an event to schedule an email with the onsite interview details
  • start the automation to send bulk emails from the database

Use n8n, a workflow automation platform, to connect Baserow with other apps by setting a trigger and action.

Now, let’s get into how to automatically schedule bulk emails from your Baserow database with n8n.

1. Create a group and database

Log in to Baserow.io. If you haven’t already, create a Baserow account on any hosted Baserow instance or a self-hosted instance.

The first step is to create a group. Click the “+ Create group” link on the Baserow Dashboard page to create a new group. Enter a group name then click the ‘Add group’ button.

If you are just getting started with Baserow, we recommend you read our user documentation on how to create a Group and how to add collaborators to your group.

For this tutorial, we will use one of Baserow’s 60+ templates. Click on ‘+ Create new’ and select ‘From template’. Add the Applicant Tracker template ****to the group:

enter image description here

Next, let’s use the Baserow trigger node to connect Baserow to n8n and run a workflow when data is received.

2. Add credentials to authenticate nodes

Log in to n8n. There are different ways to set up n8n depending on how you intend to use it. Choose a preferred way to set up n8n.

Before you integrate an app or service with n8n, you need to create credentials. We need to set up these prerequisites that will be needed in the later steps.

n8n credentials are private pieces of information issued by apps and services to authenticate you as a user and allow you to connect and share information between the app or service and the n8n node.

Authenticate the Baserow node

Use your Baserow username and password credentials to authenticate the Baserow node. Learn how to create the credentials here.

Authenticate Send Email node with SMTP

Before sending automated emails using n8n.io, ensure that you have already created an email account that is approved for sending emails on your SMTP service.

  1. Retrieve your login credentials and SMTP connection parameters from your SMTP-supported email account.

  2. In n8n, open the left menu and select Credentials

  3. Click on Add Credentials

  4. In the Add new credential dialogue, select SMTP and click on the Continue button

    enter image description here

  5. Input your login credentials and SMTP connection parameters in the fields provided. For this tutorial, we will add an Outlook.com account:

    • User: Enter your email address
    • Password: Enter the password configured in your Outlook account
    • Host: smtp-mail.outlook.com
    • Port: 587
  6. Click on the Save button

    enter image description here

3. Use the Schedule node as a trigger

The start node is the first node in a workflow and is added by default when you create a new workflow.

Before we add our regular nodes, we want to set up the Schedule Trigger node to run the workflow at fixed intervals and times.

In this tutorial, we will schedule a workflow to run every 24 hours at 09:00.

Go to the “+” and in the search box type “Cron” to add the Schedule node:

enter image description here

After selecting the node, a window will pop up to set parameters. Click the “Add Cron Time” button.

  • Mode (How often to trigger): Every Day
  • Hour (The hour of the day to trigger in 24h format): 09
  • Minute (The minute of the day to trigger): 0

Now let’s use the added credentials to authenticate Baserow and Send Email with SMTP nodes in n8n.

4. Add the Baserow node

We want to pull in data from our Applicant tracker database with the Baserow node.

Search and add the Baserow node to a new workflow:

enter image description here

Click on the Baserow node to reveal the parameters to configure. Within this section, you can

  • Select the Credential for Baserow API configured in the earlier step
  • Select “Row” as the Resource
  • Select “Get Many” as the Operation to receive many rows. Learn about Baserow operations.
  • Select “Applicant Tracker” from the list as the Database to operate on, or specify an ID using an n8n expression.
  • Select “Applicants” from the list as the Table to operate on, or specify an ID using an n8n expression.
  • Toggle on “Return All” to return all results, or set a given limit

enter image description here

Click the ‘Execute node’ button to get a response.

enter image description here

The output will display the rows in the Applicants table.

Next, let’s filter by the on-site Interview Dates.

In a workflow, n8n converts dates and times to strings between nodes. Most dates use fromISO(). Check that your date field format on Baserow matches the n8n ISO format.

Select ‘Add Option’, select ‘Filters’ then click the ‘Add filter’ button.

  • Select “On-site Interview Date” from the list as the Field to compare, or specify an ID using an n8n expression.
  • Select “Date Equals Today” from the list of Filters as the operator to compare fields and values with.

The node parameters have changed, so execute the node again to refresh the output.

enter image description here

The output will display the rows matching today’s date from the table.

That’s it, we have set the Baserow node to only get table data for dates that equal today. Next, let’s extract some of that data for use in the workflow to send information via email.

5. Add Send Email node

The Send Email node is used to send an email via an SMTP email server. Add the Send Email node to the canvas so you can send an email on the on-site interview date.

The Send Email node merely sends an email via your SMTP server and plays no part in email deliverability.

Go to the “+” and in the search box type “send email” to add the Send Email node:

enter image description here

Select the node to reveal the SMTP connection parameters to be configured. The below window will pop up to set parameters.

enter image description here

Map data between nodes

Within the parameters section, select the Credential for SMTP configured in the earlier step to authenticate the Send Email node with SMTP.

n8n expressions allow you to set node parameters dynamically based on data from a previous node. All expressions have the format {{ your expression here }}. Within the result pane, you can see the rendered result.

  • From Email: Enter the email address you want to send from in the From Email field.

  • To Email: Enter the recipient’s email address in the To Email field. In this field, map dynamic data from the Baserow node. Click on ‘Expression’ to write your expression in the expression editor. Browse and select the applicant’s email from the available data in the Variable selector:

    enter image description here

  • Subject: Enter a subject for your message in the Subject field. To personalise the subject, add dynamic data from the table to the expression:

    enter image description here

  • Text: Enter your message, in plaintext, in the Text field. Alternatively to write HTML, enter your HTML message in the HTML field.

    Click on ‘Expression’ to write your expression in the expression editor. In the expression editor, combine static text with dynamic data available from the table. Browse and select the applicant’s details from the output data in the Variable selector:

    enter image description here

  • Click on Execute Node to execute this node and output data:

    enter image description here

To attach a file to the email, you will need to use an additional node such as the Read Binary File node or the HTTP Request node to pass a file as a data property. Then use the Attachments field to attach the binary properties that contain data.

6. Execute Workflow

To test the workflow, trigger the workflow manually by going to the canvas and clicking ‘execute workflow’. After you execute the workflow, you will get a response.

enter image description here

After the test, the next step would be to save and activate the workflow. This workflow will run on the schedule you define here once you activate it.

7. Activate the workflow

Toggle the active button at the top of the canvas to activate the workflow once you’ve finished building. Activating will ensure that the workflow will fire automatically each time the trigger condition is met.

Your cron trigger will now trigger executions on the schedule you have defined. The trigger will get the rows in the table and then send automated emails to all applicants that have an on-site interview that day.

enter image description here

This will automatically run every 24 hours at 09:00 without having to click any button.

Key Takeaways

With this workflow, you can integrate Baserow in n8n to do simple tasks such as notifying users by e-mail of changes that occur within databases/tables and more.

This workflow uses the following three nodes: Cron - Baserow - Send Email to automatically send an email from a table when an event occurs.

Email scheduling is also great for sales. To get more out of the Baserow integrations, alternate the Send Email node with SendGrid, MailChimp or Salesforce node. Use our API docs and webhooks to virtually connect with any other software and automate your workflows.

What’s your story? Tell us how you use Baserow

release
January 18, 2023 by Bram Wiepjes
1.14 release of Baserow

Today we are releasing Baserow 1.14 with a new security feature — audit log, and big updates to Baserow RBAC that allow assigning roles to users or teams on individual databases and tables for even more granular permission control.

info
January 26, 2023 by Georgina Brisk
Best Airtable alternatives
info
January 10, 2023 by Olivier
No-Code Platforms in 2023
Want to contribute?

Want to write a post in collaboration with us?

How to contribute?