Create an Email Blasting GPT in 15 minutes

Create an Email Blasting GPT in 15 minutes

We've gone "all in" on GPTs for obvious reasons. Magic and Hyperlambda allows us to create super rich functionality and integrate with custom GPTs to an extent impossible to believe in before you see it.

In the following video I am basically creating an AI-based email blaster, allowing me to collect emails, and also send emails, using ChatGPT as my user interface, having ChatGPT help me write my emails. The whole thing is facilitated for using the newly released GPT feature from OpenAI, and combining it with Magic and Hyperlambda.

The video is fairly self explanatory in regards to how I create my SQL database and my CRUD endpoints to store my contacts, but the code for my "send-email" endpoint needs to be shown. Assuming you've configured your cloudlet's SMTP server settings, you can simply copy and paste the following code into a file called "send-email.post.hl", and you're basically done.

// Arguments collection declaring what arguments the endpoint accepts.
.arguments
   name:string
   email:string
   subject:string
   body:string
.description:Sends an email to the specified recipient with the specified subject and body

// Changing recipients name/email.
set-value:x:./*/mail.smtp.send/**/rec
   get-value:x:@.arguments/*/email
set-name:x:./*/mail.smtp.send/**/rec
   get-value:x:@.arguments/*/name

// Sending email.
unwrap:x:+/**
mail.smtp.send
   message
      to
         rec:john@doe.com
      subject:x:@.arguments/*/subject
      entity:text/plain
         content:x:@.arguments/*/body
return
   result:success

Watch the video above to understand how to create and interact with the GPT you just created. Below are some example prompts you can use to interact with your GPT once you're done creating it.

  • Create a new contact named John Doe with email being john@doe.com
  • Help me create an email with a great recipe for pancakes with a catching subject and body and send it to John Doe

Have a Custom AI Solution

At AINIRO we specialise in delivering custom AI solutions and AI chatbots. If you want to talk to us about how we can help you implement your next custom AI solution, you can reach out to us below.

Thomas Hansen

Thomas Hansen I am the CEO and Founder of AINIRO.IO, Ltd. I am a software developer with more than 25 years of experience. I write about Machine Learning, AI, and how to help organizations adopt said technologies. You can follow me on LinkedIn if you want to read more of what I write.

Published 16. Nov 2023

Create a Low-Code GPT AI App in 5 Minutes

By combining AINIRO with OpenAI's GPTs you can wrap your entire database in a CRUD app in 5 minutes, using AI to interact with your database

Read More

Connect your ChatGPT Assistant to your SQL Database

In this article I demonstrate how to connect your ChatGPT assistant to your own database using Magic, giving you SQL query powers from ChatGPT.

Read More

Using C# as a Scripting Language

With Magic you can dynamically compile C# code on the fly, and execute almost as if it was a scripting language. In this article I show you how.

Read More