Skip to main content

Automated Sales Emails

AgentHub uses tools like ChatGPT to generate information, but the real magic is in all the infrastructure surrounding those tools -- infrastructure like the ability to send emails based on AI-generated content.

This is an example of how personalized sales emails can be generated and sent automatically with an AgentHub pipeline.

Link to the pipeline to follow along: โœ‰๏ธ Automated Sales Emails

Alt text


The goal of this pipeline will be to take in some basic information about the customer, about the product that we are selling, and then directly send off that email.


We will start by taking user input by text.

For this we will use the "Input" node, one for the customer information, and one for the product information.

Alt text

Data Manipulation & Generation#

We will be using an "Ask ChatGPT" node to generate the sales email, but we will first formulate the necessary context so that the email is sufficiently personalized.

"Context" is extra information that ChatGPT can reference when answering a user's query, which in our case will be the request to generate the email.

We can use a "CombineStrings" node to generate this context, combining the customer information and product information from the original input.

Alt text

Here the context in our "CombineStrings" node would look something like this:

Here is the customer information:
Customer Name: Samantha SmithCustomer Email: samantha.smith@acmecorp.comCustomer Job Title: Procurement ManagerCompany Name: Acme Corp Industries
Here is the product information:
Product Name: EfficiencyMax Cooling SystemProduct Description: A state-of-the-art industrial cooling system designed to reduce energy costs and enhance performance.Unique Selling Points:        - Utilizes cutting-edge AI algorithms to optimize cooling patterns, saving up to 25% in energy costs.        - Designed with a focus on sustainability, using eco-friendly refrigerants.        - Comes with a robust five-year warranty and 24/7 dedicated support.

For our Ask ChatGPT prompt, we will tell it to use the context to generate a 1 page PDF financial analysis report:

You are an expert salesperson with decades of sales and marketing experience. I want you to generate a cool and casual outbound sales email for a customer given customer information and product information in the context.

The email should highlight the product in a way that doesn't comes across as too pushy or salesperson-like.

Don't include a subject line.

We can use another Ask ChatGPT operaator to generate a subject line for this email. And we can re-use the exact same context as for our email, just changing the prompt to

Generate a subject line for an outbound sales email tailored to the customer and product information in the given context.

Do not include quotation marks or anything other than the subject line in plain text.

Alt text

Notice in the above pipeline that we are using the output from the "CombineStrings" node, i.e. the customer/product information context as inputs for multiple nodes. Outputs are often used in multiple places where it makes sense.

Finally, we can use a "GmailSender" node to send an email with the generated context and subject line.

Alt text


Here is what the final email looks like when sent from the pipeline:

Alt text

And that's pretty much it!

There are many enhancements that can be made it here:

  • More context added to make emails more personalized
  • "Prompt Engineering" to make the email sound more human-like
  • CSV readers to read-in customer/product information and send emails en massse

and whatever else you can come up with!