Creating a Workflow to Run When an Email is Received
Automating tasks can greatly improve workflow efficiency. One effective approach is setting up a workflow that initiates when an email is received.
Learn how to create a workflow to handle incoming emails and save them in a database. To handle incoming emails, we need to forward them to a designated address and then send the data to a database.
For example, we can create a simple workflow to categorise each email we receive from clients as either an 'Order' or an 'Inquiry' and store them in a database.
Here are the basic steps to achieve that.
Setting Up Email Forwarding
Creating a Database with Content-Aware Autofill Feature
Creating the Workflow
Testing the Workflow
1) Setting Up Email Forwarding
Generally, we cannot directly listen to incoming emails. However, we can configure forwarding of incoming emails to another address.
Steps to Set up Email Forwarding
Log in to your Gmail account that you want to forward emails from.
In the top right, click Settings and click See all settings.
Click the Forwarding and POP/IMAP tab.
In the "Forwarding" section, click Add a forwarding address.
Enter the email address you want to forward emails to e.g., collins.eutech@inbox.lucyhq.com.
Click Next. Complete the Google verification process.
Click Proceed and Click OK.
A confirmation link will be sent to the email address that you want to forward emails from. Click the link in that message.
Click Confirm. Note: Confirmation is necessary to ensure that incoming emails are redirected to the original email address.
Go back to the settings page for the Gmail account you want to forward messages from, and refresh your browser.
Click the Forwarding and POP/IMAP tab.
In the "Forwarding" section, select Forward a copy of incoming mail to and it will automatically pick your forwarding email address.
Choose what you want to happen with the Gmail copy of your emails. We recommend Keep Gmail's copy in the Inbox.
Click Save Changes.
2) Creating a Database with Content-Aware Autofill Feature
Let's create a simple database.
On the app homepage, go to the My Work tab on the left sidebar.
All the folders you have created, as well as those created by others, will be listed.
Click on the required folder to open it.
Go to the Databases tab.
Click the Plus icon and pick the Create Manually option.
Enter a meaningful name for your database.
Click Continue.
Click Skip this Step.
Add Fields to the database.
Click Go to Next Step. Once you have designed the structure of your database, click Create New Database. An empty database will be created.
Utilising Content-Aware Autofill to Automatically Populate Your Database
After creating the database, insert data into it and activate the content-aware autofill feature.
Refer to this article on how to use content-aware autofill to auto populate your database.
This is an example of the database we created.
3) Creating the Workflow
Next, let's create the workflow.
On the Lucy app homepage, click the My Work tab on the left.
All the folders you have created, as well as those created by others, will be listed.
Click on the desired folder.
Inside the folder, click the Workflows tab.
Click the + icon. Workflow editor page will open.
Select the email trigger and configure it.
Click the How do you want to trigger your workflow? box.
Pick When someone send a email trigger from the list.
Enter the email address that you want to forward emails to, e.g., collins.eutech@inbox.lucyhq.com.
Click Use this email address. The trigger block will be added and displayed on the workflow editor page.
Add the block that defines the action to execute when the workflow is triggered.
Click the + icon of the trigger block.
Click on the Databases and Analytics category and pick Insert into Database block. The selected block will be added and displayed.
Select the Database you wish to insert data you receive.
Once the database is selected, its fields will be displayed.
Add Pills to the required fields. Pills originate from previous blocks added in the workflow, and you can use them in input fields.
Click on a field and a list of pills will appear in a pop-up window. Select required pills from the pop-up to be added in the field.
Customise each field as necessary.
Provide a suitable name for the workflow in the text box on the top left.
Click Save.
3) Testing the Workflow
Each incoming email will be automatically forwarded to the designated address, recorded in the corresponding database, and categorised accordingly.
Watch this video on how to automate handling incoming emails and saving them in a database.
Last updated