How to Use Zapier and ChatGPT to Find Newsletter Sponsors

One of the best ways to identify potential sponsors for an email newsletter is to monitor other newsletters.

It sounds simple enough, but for a newsletter creator, it can feel like there are just two options. You can either manually monitor dozens or even hundreds of newsletters, or you can pay several thousand dollars a year to use a service.

Recently, I came up with a third option. I built a rudimentary email parser that captures emails, identifies sponsors, and produces a spreadsheet I can use to prospect potential advertisers.

The Email Parser

This very basic parse requires a domain, a Zapier Pro account, paid access to the ChatGPT API, and a Google Drive account.

Set Up an Email Address

Start with an Email by Zapier trigger. In the configuration step, this trigger will provide an email address. You will need to customize it a little, but it will probably look like this: example.1234z@zapiermail.com.

The Email by Zapier trigger will give you an email address to receive inbound newsletter. I also used a email forward so that I could sign up for newsletters with an email address that did not include the work "Zapier."

Next, I went to my domain registrar and set up an email forward so that the email address armando@adomainiown.com forwarded to the Zapier address example.1234z@zapiermail.com.

Email verification was a little tricky. I had to capture the verification message in Zapier, extract the HTML output from the zap, create an HTML file, and open the file in a browser to find and click the verification link. But this was just about the most technical part of the entire process.

Ask ChatGPT

The next action in the zap is to ask ChatGPT to identify the sponsor in an inbound email.

The body of the email newsletter is passed to ChatGPT as HTML.

ChatGPT was surprisingly good at identifying sponsors in my initial tests, but I had to add the exact format I wanted in the "Assistant Instructions" section of the zap.

I included the desired output format in the "Assistant Instructions" section of the zap.

Parse the JSON

The output from ChatGPT must be parsed to extract the values for the sponsor name, ad copy, image URL, and link.

A Code by Zapier action allowed me to output the individual fields from the JSON.

Although I consider myself a capable Javascript developer, I asked Zapier's code AI to generate a script to parse and output an object.


const jsonString = inputData.json || '';

// Extract the JSON part from the code block format
const jsonMatch = jsonString.match(/```json\n([\s\S]*?)\n```/);
const jsonData = jsonMatch ? jsonMatch[1] : '{}'; // Default to empty object if no match

try {
  // Parse the JSON string to a JavaScript object
  output = JSON.parse(jsonData);
} catch (error) {
  // In case of a parsing error, return an empty object
  output = {"advertiser_name":"none","ad_copy":"none","Image_url":"none","link_url":"none"};
}

Connect to a Google Sheet

The final step in the zap is to connect to a Google Sheet, adding a row each time a new sponsor is found.

The fields are then assigned to columns in a Google Sheet.

Just like that, the sponsor information is added to the designated Google Sheet.

This basic sponsor information is enough to get started reaching out to sponsors.

Getting Newsletters

Start signing up for the email newsletters you want to track and use the sponsors they get as your newsletter's sponsorship lead list.