May 17, 2024

How to Generate Personalized Emails from your Snowflake CDP with Snowflake Cortex, Snowpark, & Hightouch

By Elliot Johnson

I’ll admit it. I read advertisement emails. The psychology behind it fascinates me. The show Mad Men, created by AMC, really piqued my interest in what makes a strong advertising/sales campaign. 

For those who don’t know, the show takes place during the “Golden Age of Advertising” in the 1960s. It follows a cast of chain-smoking, binge-drinking Ad Men (and women) as they navigate a tumultuous time in American history to create broadly appealing and eye-catching advertisements. 

Barraging your eyes, ears, and emotions to grab your attention for a fraction of a second, they have you! It’s hard to believe, but golden age advertising was closer to the Titanic sinking than it is to us today. But, like all cyclical trends, a new golden age of advertising is upon us.

This is not an age of broad appeal! This is the age of precision and veracity. Gone are the days of martini lunches and week-long brainstorming sessions. Today, data is king. A potential customer has already given you the information you need to be successful. And what is success? 

Get them to open your sales email for that fraction of a second. That’s the goal of today’s blog. Craft an email so personalized and so appealing that the reader can’t help but want to read more. We will use the newest Snowflake Data Cloud AI features to craft a personalized email that the receiver will think took weeks to craft but in reality, it only took a matter of seconds. Take that, Don Draper!

This blog is a refresh of a previous blog seen here, but it uses the brand new Snowflake AI feature, Cortex LLMs. This feature makes using, swapping, and maintaining LLMs simple and user-friendly. So, let’s jump in.

What Has Changed About the LLM Hosting Process?

In the old model of LLM hosting. Large Language models had to be hosted using expensive GPUs and container services like docker or Kubernetes. That required a lot of upkeep and technical knowledge to maintain. Snowflake Cortex has removed all that hassle by self-hosting the models and allowing you access to the models using a simple Python or SQL command.

How to Set Up and Use Cortex LLMs

In this 3 part series, we will fully utilize Snowflake Cortex LLM to create custom sales emails for our catering company, Yummy Cupcakes.

Our first video will walk you through the data set we have mocked up for this demo. This includes company contact information, previous events, and lastly a few sales notes.

This second part will walk you through the Python code we created inside a Snowflake sheet. This includes each method and the setup needed to run the code.

In the final video, we will review the run statistics of our LLM-powered email generator. Also, we will review the location and the results of our code. This includes a look into one of the generated emails. Check out the incredible precision and power of Snowflake Cortex LLM.

Closing

In this demo, we learned how to organize CRM data in Snowflake. Then, we used a Python sheet in Snowflake web UI to pull our data frame and organize it. Using our organized Python dictionary, we created a prompt for any LLM to write a customized email. With our newly created prompt, the easy-to-use and convenient Cortex LLM took over, and using any model we chose, we created a personalized email. 

Lastly, we saved those emails to a Snowflake table ready to be shipped back to our CRM for distribution. We hope you found this helpful and easy to replicate for your business. 

If you have any questions or need support using Cortex LLM, please feel free to reach out to phData. Our industry-leading AI and ML teams are happy to help you get the most out of your data.

Data Coach is our premium analytics training program with one-on-one coaching from renowned experts.

Accelerate and automate your data projects with the phData Toolkit