Work

Copywriter

Dev
Full-stack
OpenAI

I built an email copywriting application using OpenAI, Next.js, tRPC, TailwindCSS, and Planetscale.

Screenshot of an elegant email copywriting application

About the Project

I built an email copywriting application with OpenAI, Next.js, tRPC, TailwindCSS, NextAuth.js, and Prisma. Since the application doesn’t usually operate under heavy load where an always-running instance is required, I opted to use Planetscale as a serverless MySQL database.

The application can run in one of two modes:

  • client-specific
  • playground.

You can find a demo of the application here.

Playground Mode

The playground mode is self-explanatory: you simply pass in a prompt and the API will generate a response.

Client-Specific Mode

The client-specific mode is a bit more complex. Clients are first created using a number of descriptors, such as their name, industry, and tone. Then, the client’s previous marketing materials, such as emails, are added to their profile.

To generate new marketing emails, the user simply passes in a prompt for what kind of campaign they’d like to run, for instance “I’d like to advertise 50% off Basketballs for March Madness”. The user selects which of the emails they’d like to include in the prompt, and then all of that data is formatted and passed to the OpenAI API.

What is returned is an email matching the initial prompt, along with all of the parameters they wanted to include.

History View

In either of these modes, responses are saved into a database so that users can go back and view their previous prompts and responses in the history view. The history view itself is implemented as an infinitely scrolling page, so the user can continuously scroll through their history without having to navigate to a new page.

In addition to viewing your history, you can bookmark past responses so that you can easily access them later.

The end result is a fully-fledged email which can be then used for the client’s marketing campaigns.