Ben's Bites
← Back
.md

Review marketing emails and synthesize learnings

Build an AI automation that studies marketing sequences in your inbox and recommends effective drip campaign strategies.

intermediate pro
Tool: Lindy AI Topic: EmailTopic: Marketing

2024-12-10

Marketing emails in your inbox are valuable learning resources. However, we usually just delete these emails or save them without much thought. Later, when it's time to create our own marketing emails, we either start completely fresh or waste time searching through old emails for ideas.

Here's a better way: imagine having an AI tool that automatically organizes your marketing emails and helps you learn from them. This tool can suggest ideas for your business's email marketing by analyzing what other companies are doing. That's exactly what we're going to create in this tutorial.

We’ll use Lindy to create an email monitoring and labeling workflow and a query agent that can query all the best marketing emails in your inbox and use them as inspiration for your marketing campaigns.

Steps we’ll follow in this tutorial:

  • Set up your inbox monitor
  • Create labeling logic
  • Develop your email querying workflow
  • Test and iterate

Tools:

  • Gmail

Let’s get into it!

Set up your inbox monitor

On your Lindy homepage, click the “New Lindy” button to get started.

__wf_reserved_inherit

Select the “Start from scratch” option on the resulting pop-up window.

__wf_reserved_inherit

This will take you to the Lindy flow editor page. This will be a two-part workflow: one flow automatically labels marketing emails and the other allows us to query that folder. We’ll get started with the auto-labeling flow. To do this, click the “Select Trigger” option.

__wf_reserved_inherit

Then, select the Gmail application.

__wf_reserved_inherit

For the trigger action, select “Email Received”.

__wf_reserved_inherit

Connect your Gmail account in the top right corner of the “Email Received” action editor.

__wf_reserved_inherit
💡 Tip: This step will ingest all of your emails as a trigger to the flow. If you want to filter specific emails out, you can add a trigger filter on this step and set conditional logic on this action editor. For our purposes, we’ll set no trigger filter.

Create labeling logic

With our email now triggering the flow, we can add a condition to auto-label marketing emails. To do this, click the “Condition” option in the “Select next step” dialog box.

__wf_reserved_inherit

For the condition, we’ll use an AI prompt to define this conditional labeling.

Sample Prompt:

The email is a marketing email.
__wf_reserved_inherit
💡 Tip: This is one area where Lindy shines. You can use AI prompts for complex, ambiguous workflow logic. To do this filtering without AI would be virtually impossible in a workflow builder.

With our condition set, we can now add the inbox label. To do this, click the “+” button below the condition step and select “Perform an action”.

__wf_reserved_inherit

Search “Gmail” and select the “Add Label to Email” action option.

__wf_reserved_inherit

In the action editor, update the “Label Name” to “Marketing”. (Or, your preferred label name of choice).

__wf_reserved_inherit

Develop your email querying workflow

That’s it for our email labeling flow! Now, we can set up our email querying flow. This is where we’ll trigger Lindy to query our “Marketing” email folder based on a certain request. To do this, click on the “Add Trigger” button in the top left corner of the flow editor.

__wf_reserved_inherit
💡 Tip: With Lindy, you can set up one flow with multiple triggers. This cuts down on the amount of Lindies you need to manage for a single, connected process with different entry points.

In the resulting pop-up window, select the “Chat” option from the “Popular Triggers” section.

__wf_reserved_inherit
💡 Tip: We’re planning to trigger our query from the Lindy app, which is why we’re using the “Chat” action. However, if you want to trigger this from email, Slack, or another way (i.e. like a scheduled trigger), you can select another trigger here for this part of the workflow.

With our trigger selected, we can set the “Greeting Message” to make it clear what we need to chat to properly trigger this workflow. We’re going to send a specific sender’s email to trigger the query, so we’ll set the “Greeting Message” accordingly.

Greeting Message:

Send me the sender email of te marketing sequence you want to breakdown.
__wf_reserved_inherit

With the trigger set, we’ll add the email query action to this flow by clicking the “Perform an action” option in the flow editor.

__wf_reserved_inherit

In the resulting pop-up, search for “Gmail” and select the “Search Emails” action option. This action will allow us to query our email inbox specifically for emails stored in our new “Marketing” label.

__wf_reserved_inherit

In the action editor for this step, we’ll set the parameters of our search. For “Max Results” we’ll leave it at the default 20. For the “From” field, we’ll update the mode to “Prompt AI” and instruct the AI to query for emails with the email or name from our previous “Message Received” step.

Sample Prompt:

The name or email addresses provided by the user.
__wf_reserved_inherit
💡 Tip: We’re constraining our query by the “From” field, but you don’t have to do this. You could expand your query to a different or broader set of parameters.

Lastly, at the bottom of this action step editor, we’ll set the “Label Names” to “Marketing”. This will constrain the email search to just emails with that label.

__wf_reserved_inherit

To finish off this part of the flow, we’ll need to add a step where Lindy will message us back with the synthesis of the marketing emails from the query and provide a recommendation for our own marketing messages accordingly. To do this, click the “+” button under the “Search Emails” step and select the “Perform an action” option.

__wf_reserved_inherit

Select the “Chat” option from the “Recommended” section in the resulting pop-up window.

__wf_reserved_inherit

Then, select the “Send Message” action.

__wf_reserved_inherit

The “Message” field is where we’ll instruct the Lindy via a prompt on how to synthesize the email query results and what to send us back as a result. Update this field setting to “Prompt AI” and provide your instructions. Make sure to include the ‘emails’ variable from the previous step as an input.

Sample Prompt:

Review these emails: [insert ‘emails’ variable]And give me some ideas on how to create similar email sequences that would resonate with people on my mailing list. The content of my mailing list focuses on marketing automation.
__wf_reserved_inherit

Test and iterate

Our flow building is complete! Make sure to click the “Save” button in the top right corner of the page, and then click the “Test” button to test the workflow.

__wf_reserved_inherit

Rather than testing the automated labeler, we’re just going to test our marketing message synthesizer flow. So we’ll go to our Gmail inbox, create a “Marketing” label, and manually label some emails with the label (we’re labeling emails from Lindy, to demonstrate this step):

__wf_reserved_inherit

Back in Lindy in the Test pane, we’ll click the “Message Received” option to test that part of the workflow.

__wf_reserved_inherit

In the chat, we’ll type the sender email address of the test emails (hello@lindy.ai in our case).

__wf_reserved_inherit

Lindy will query all of those emails that are in the “Marketing” folder that are from that email address and provide us with a recommendation on how we can implement a similar email marketing campaign for our business.

__wf_reserved_inherit

And that’s it! You now have an email AI analyzer that studies marketing sequences in your inbox and recommends effective drip campaign strategies for your business.

This tutorial was created by Garrett.

Upgrade to Pro

This tutorial contains Pro content. Upgrade to access the full tutorial and all Pro features.

Get Pro Access