{"id":137825,"date":"2023-07-21T12:26:50","date_gmt":"2023-07-21T10:26:50","guid":{"rendered":"https:\/\/spotler.com\/guides\/hoe-we-van-simpele-data-een-ai-powered-email-maakten"},"modified":"2026-03-16T15:04:43","modified_gmt":"2026-03-16T14:04:43","slug":"how-we-turned-simple-data-into-an-ai-powered-email","status":"publish","type":"guides","link":"https:\/\/spotler.com\/en-gb\/guides\/how-we-turned-simple-data-into-an-ai-powered-email","title":{"rendered":"How we turned simple data into an AI-powered email"},"content":{"rendered":"<div class=\"wp-block-cover\"><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim-50 has-background-dim\"><\/span><img decoding=\"async\" class=\"wp-block-cover__image-background wp-image-18419\" alt=\"\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2024\/05\/guide-aipoweredemail-titlecover.jpg\" data-object-fit=\"cover\"\/><\/p>\n<div class=\"wp-block-cover__inner-container is-layout-constrained wp-block-cover-is-layout-constrained\">\n<h1 class=\"wp-block-heading has-text-align-center has-white-color has-text-color has-link-color has-large-font-size wp-elements-0966b18d09ac3ca9374de5c23f539ca1\" id=\"h-hoe-we-van-simpele-data-een-ai-powered-e-mail-maakten\">How we turned simple data into an AI-powered email<\/h1>\n<\/div>\n<\/div>\n<p><strong>Now that everyone knows what ChatGPT is, the blogs and LinkedIn posts are flying around you.\u00a0The possibilities are endless, with loads of pre-made prompts that turn your idea into an AI-executed reality.\u00a0But entering a prompt in ChatGPT remains limited to that functionality as well.\u00a0As a marketer who prefers to automate everything, we set to work to enrich our emails with ChatGPT.\u00a0The result?\u00a0A personalized poem in an AI-powered email that is completely tailored to its recipient.\u00a0Below, you can read what that process looks like, and we&#8217;ll show you how you can apply this to your emails as well.\u00a0<\/strong><\/p>\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\" id=\"basis\">What did we need?<\/h2>\n<ul class=\"wp-block-list\">\n<li>A\u00a0<strong>form<\/strong>, using the\u00a0<a href=\"https:\/\/spotler.com\/en-gb\/mailplus\" data-type=\"page\" data-id=\"78387\">module from Mail+<\/a>\u00a0;\u00a0<\/li>\n<li>A\u00a0<strong>landing page<\/strong>, also from Mail+;\u00a0<\/li>\n<li>A\u00a0<strong>connection<\/strong> between the form submission and Spotler SendPro, we used\u00a0Zapier\u00a0for this;<\/li>\n<li>You guessed it right from the previous bullet point:\u00a0<a href=\"https:\/\/spotler.com\/en-gb\/sendpro\" data-type=\"link\" data-id=\"https:\/\/spotler.com\/en-gb\/sendpro\">SendPro<\/a>;\u00a0<\/li>\n<li>A license with an&nbsp;AI tool, in our case OpenAI;&nbsp;<\/li>\n<li>A little understanding of <strong>webhooks and APIs<\/strong>, but\u00a0<a href=\"https:\/\/mailplus.spotler.help\/hc\/en-us\/search?utf8=%E2%9C%93&amp;query=post+request\" target=\"_blank\" rel=\"noreferrer noopener\">we&#8217;re happy to help you with<\/a>\u00a0that too.\u00a0<\/li>\n<\/ul>\n<p>In this simple example we trigger an email in SendPro from a Mail+ form, via a webhook.\u00a0That email is built up based on data from the form and enriched with an AI-generated poem.\u00a0We wanted to keep what we ask for in this form as simple as possible, but we wanted to request enough data to be able to personalize it.\u00a0For example, we only asked for\u00a0<strong>email address<\/strong>,\u00a0<strong>name<\/strong>,\u00a0<strong>language<\/strong>,\u00a0<strong>company<\/strong>,\u00a0and <strong>the\u00a0industry<\/strong>\u00a0in which the company is active.\u00a0<\/p>\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\" id=\"formdata\">Step 1:\u00a0Processing form data<\/h2>\n<p>When you collect form data in Mail+, you naturally want to be able to use it in the rest of the process.\u00a0To forward that data from one system to another, we used a webhook.\u00a0You can find this in the &#8216;Processing&#8217; section of Mail+ forms.\u00a0Here you set an address (see\u00a0<em>step 2)<\/em> where the data should go &#8211; a\u00a0POST request.\u00a0<em>It is also important to map<\/em>\u00a0the data from the forms, which ensures that another system can process your data again.\u00a0\u00a0<\/p>\n<div style=\"height:21px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h4 class=\"wp-block-heading has-blue-color has-text-color has-link-color wp-elements-271f958f51b8871a8b28d2266bb87bec\" id=\"mapping\">Data mapping&nbsp;<\/h4>\n<p>Data mapping really means ensuring that database fields match.\u00a0Does system 1 handle first names as &#8216;firstname&#8217; and system 2 as &#8216;fName&#8217;?\u00a0 Then during the mapping, you ensure that system 1 sends the first name as &#8216;fName&#8217; to system 2, with the value being the data that system 1 knows as &#8216;firstname&#8217;.\u00a0That looks something like this:\u00a0<\/p>\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"756\" height=\"488\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/mapping.jpg\" alt=\"\" class=\"wp-image-14884\" srcset=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/mapping.jpg 756w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/mapping-300x194.jpg 300w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/mapping-294x190.jpg 294w\" sizes=\"(max-width: 756px) 100vw, 756px\" \/><\/figure>\n<\/div>\n<p>Now that the form is ready, the next step is to make it available on your website.\u00a0In our case a simple landing page, but you can also easily integrate Mail+ forms\u00a0with your website.<\/p>\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\" id=\"verwerken\">Step 2:\u00a0Process the data and trigger an email<\/h2>\n<p>Now that the form can receive and forward the data, it&#8217;s time to let that second system do its job.\u00a0If you are an advanced API specialist, you can skip the following, but for ease of use we have chosen to hang Zapier between the systems.\u00a0<\/p>\n<div style=\"height:21px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h4 class=\"wp-block-heading has-blue-color has-text-color has-link-color wp-elements-4d725158b24af0cc58a348e68ded9b67\" id=\"zapier\">What is Zapier?\u00a0<\/h4>\n<p>Zapier is a tool that allows you to link different systems together and add actions to them, from a user-friendly interface.<\/p>\n<p>Setting a trigger in Zapier based on a webhook (&#8216;Webhooks by Zapier&#8217;) generates an address that you can use in\u00a0<em>step 1<\/em>.\u00a0The webhook URL consists of a series of unique numbers and letters, as in the (modified) example below:\u00a0\u00a0<\/p>\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"591\" height=\"340\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2024\/09\/ai-blog-zapier-webhook.png\" alt=\"\" class=\"wp-image-115653\" srcset=\"https:\/\/spotler.com\/wp-content\/uploads\/2024\/09\/ai-blog-zapier-webhook.png 591w, https:\/\/spotler.com\/wp-content\/uploads\/2024\/09\/ai-blog-zapier-webhook-300x173.png 300w, https:\/\/spotler.com\/wp-content\/uploads\/2024\/09\/ai-blog-zapier-webhook-330x190.png 330w\" sizes=\"(max-width: 591px) 100vw, 591px\" \/><\/figure>\n<\/div>\n<div style=\"height:21px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h4 class=\"wp-block-heading has-blue-color has-text-color has-link-color wp-elements-c53d95f0efaab793e1473a48f680dc12\" id=\"sendpro\">From Zapier to SendPro<\/h4>\n<p>In Zapier, supported by the form data, you can have a message sent by Spotler SendPro.\u00a0SendPro then allows you to transform that data into a beautiful, personalized email.\u00a0To do that, we first had to make sure that all that e-mail traffic is secure.<\/p>\n<p>To be able to trigger your emails from Zapier in SendPro, you must first establish a connection with your account.\u00a0For this you need your account ID and you need to\u00a0<a href=\"https:\/\/sendpro.spotler.help\/hc\/en-gb\/articles\/8156254834962-Setting-up-a-Source\" target=\"_blank\" rel=\"noreferrer noopener\">create a Source<\/a>.\u00a0In Zapier we have set up this process in two steps:<\/p>\n<ol style=\"list-style-type:1\" class=\"wp-block-list\">\n<li>Get authentication from SendPro to be able to send the email through your account;<\/li>\n<li>Deliver the data with the authentication keys generated by SendPro.<\/li>\n<\/ol>\n<h5 class=\"wp-block-heading\">Authentication<\/h5>\n<p>Unique authentication keys (OAuth) are created for every email that needs to be generated \u2013 to prevent someone from getting their hands on them and emailing you using your account.\u00a0The response of the POST request to SendPro contains the following:<\/p>\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"732\" height=\"161\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/access_token.png\" alt=\"\" class=\"wp-image-14887\" srcset=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/access_token.png 732w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/access_token-300x66.png 300w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/figure>\n<\/div>\n<p>As you can see in the image above, each key expires after 60 seconds.\u00a0We then use the key itself (<em>access_token<\/em>) in a call to SendPro to send a message.<\/p>\n<h5 class=\"wp-block-heading\" id=\"h-lever-de-data-aan-bij-sendpro\">Deliver the data to SendPro<\/h5>\n<p>In the next step, you use the access_token to be able to offer an e-mail in the correct account with the correct authentication.\u00a0<a href=\"https:\/\/flowmailer.com\/apidoc\/sendpro-api.html#post_account_id_messages_submit\" target=\"_blank\" rel=\"noreferrer noopener\">In that POST request,\u00a0you process all the data you want to send to SendPro:<\/a><\/p>\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"459\" height=\"450\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/post_method.png\" alt=\"\" class=\"wp-image-14888\" srcset=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/post_method.png 459w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/post_method-300x294.png 300w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/post_method-194x190.png 194w\" sizes=\"(max-width: 459px) 100vw, 459px\" \/><\/figure>\n<\/div>\n<p>Based on the data or the source of the message (in this case Zapier), SendPro knows exactly which steps it needs to take to format and deliver your message.<\/p>\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\" id=\"enrich\">Step 3:\u00a0Enriching the email data with Artificial Intelligence and a design<\/h2>\n<p>Now you have prepared data from your Mail+ form to be used in other tools.\u00a0In an earlier step we created a Source in SendPro, which we will now use.<\/p>\n<p>In this case we call the Source &#8216;Event API&#8217; \u2013 because it was made specifically for, you guessed it, events.\u00a0The moment data arrives via this source, you can indicate in SendPro what should be done with it via Flows: the way to set up your e-mail journeys.<\/p>\n<div style=\"height:21px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h4 class=\"wp-block-heading has-blue-color has-text-color has-link-color wp-elements-c9ba0228d181ef63433cb7585a700b33\" id=\"flows\">Push the data through a Flow<\/h4>\n<p>When creating such a Flow, you can select on which source or other condition this Flow should be triggered.\u00a0For example, you can also trigger a different Flow on specific data within a message.\u00a0For now, we&#8217;ll keep it a bit simpler and all messages from the &#8216;Event API&#8217; source will go through this Flow:<\/p>\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"636\" height=\"358\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/flowmailer_flow.png\" alt=\"\" class=\"wp-image-14889\" srcset=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/flowmailer_flow.png 636w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/flowmailer_flow-300x169.png 300w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/flowmailer_flow-338x190.png 338w\" sizes=\"(max-width: 636px) 100vw, 636px\" \/><\/figure>\n<\/div>\n<p>We then indicate in the Flow what should be done with your message, step by step.\u00a0We have only provided some form data, so we want to connect to ChatGPT (the &#8216;External Data&#8217; step) and add a template where we can display that data.\u00a0You can do that easily by dragging the appropriate &#8216;Flowsteps&#8217; onto the timeline:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"800\" height=\"449\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/flow_drag_drop.gif\" alt=\"\" class=\"wp-image-14890\"\/><\/figure>\n<\/div>\n<div style=\"height:21px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h4 class=\"wp-block-heading has-blue-color has-text-color has-link-color wp-elements-439facf1ee817ffafde819e2d0831604\" id=\"flowsteps\">Get started with Flowsteps<\/h4>\n<p>Within Flows you work with Flowsteps;\u00a0the steps a message must undergo before it is delivered.\u00a0In our case, we put an External Data step on the timeline that allows external data to be retrieved, posted somewhere, or updated during the sending process.\u00a0For example, we can ask ChatGPT to write us a nice poem:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"493\" height=\"397\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/chat_prompt.png\" alt=\"\" class=\"wp-image-14891\" srcset=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/chat_prompt.png 493w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/chat_prompt-300x242.png 300w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/chat_prompt-236x190.png 236w\" sizes=\"(max-width: 493px) 100vw, 493px\" \/><\/figure>\n<\/div>\n<div style=\"height:21px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h4 class=\"wp-block-heading has-blue-color has-text-color has-link-color wp-elements-b24d7a0714a47f695cc85cecc401478a\" id=\"chatgpt\">Using ChatGPT in your transactional email<\/h4>\n<p>With a simple prompt, you can instruct ChatGPT to write a personalized text with a simple prompt.\u00a0Please note we have explicitly requested permission to have personal data processed by ChatGPT.\u00a0If you do not want to work with personal data, you can always use other data, such as &#8216;language&#8217;, &#8216;company&#8217; or &#8216;industry&#8217;.<\/p>\n<p><em>The attentive viewer will see in the request body that we are using model &#8216;text-davinci-003&#8217; and not the\u00a0latest version of GPT.\u00a0At the time of making this example,\u00a0gpt-4\u00a0was not yet available &#8211; but Davinci is fine for this use case.<\/em><\/p>\n<p><strong>The prompt is simple:<\/strong><\/p>\n<p>\u201cWrite a short poem in ${language} about the adventures of ${firstname} ${<a>lastname<\/a>}, working at ${company} in the ${industry} industry.&nbsp;Can you replace the \/n with &lt;<a>br<\/a>&gt;?\u201d<\/p>\n<p>This prompt gives you a short poem and ends each line with an HTML break, making it easier to use in your email.&nbsp;For example, I got:<\/p>\n<p class=\"has-light-blue-background-color has-background\">\u201cTom Blijleven,<br \/>Tech adventures,<br \/>Spotler, his home,<br \/>He works hard and smart.<br \/>He learns a lot,<br \/>And never stands still,<br \/>He is a tech hero,<br \/>With a big will.\u201d<\/p>\n<p>Although I do not expect that we have found our new Shakespeare with ChatGPT, these types of AI-generated texts do of course offer opportunities to hyper-personalize your content.\u00a0But first make sure that this content can also be processed in your e-mail.<\/p>\n<div style=\"height:21px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h3 class=\"wp-block-heading\" id=\"design\">A design sauce over all that data<\/h3>\n<p>The\u00a0<em>finishing touch<\/em>\u00a0for any email is its design.\u00a0That bucket of data is nice, but without a nice wrapper around it, no one will remember your emails.\u00a0In SendPro you handle this super efficiently with the smart template composer.\u00a0This allows you to make one template in multiple languages, without making different variations.<\/p>\n<p>For this example, we created one leading template that is filled with texts from SendPro&#8217;s Language Packs.\u00a0Based on the language indicated in the form, the template is filled in with the correct text.\u00a0For example, we created these three variations in Dutch,\u00a0German\u00a0and\u00a0English\u00a0with just one template:<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1920\" height=\"962\" src=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations.png\" alt=\"\" class=\"wp-image-14892\" srcset=\"https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations.png 1920w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations-300x150.png 300w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations-1024x513.png 1024w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations-768x385.png 768w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations-1536x770.png 1536w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations-767x384.png 767w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations-200x100.png 200w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations-379x190.png 379w, https:\/\/spotler.com\/wp-content\/uploads\/2023\/07\/variations-817x409.png 817w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n<p>With the right tools, you can create a personalized email from just a little bit of data.\u00a0In this example we have chosen a limited use case, but one that offers sufficient tools to reconsider which data you request and what you do with it in your emails.\u00a0Do you want to try this for yourself?\u00a0Please contact\u00a0<a href=\"mailto:tom.blijleven@spotler.nl\">tom.blijleven@spotler.nl<\/a>\u00a0or be inspired by one of\u00a0<a href=\"https:\/\/spotler.com\/en-gb\/demo\" data-type=\"link\" data-id=\"https:\/\/spotler.com\/en-gb\/demo\">our product demos<\/a>.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI and email can do a lot, but how do you actually do this? In this guide, we&#8217;ll tell you how we turned simple data into an AI-powered email!<\/p>\n","protected":false},"featured_media":239796,"template":"","cat_industry":[],"cat_topic":[1592,1002],"class_list":["post-137825","guides","type-guides","status-publish","has-post-thumbnail","hentry","cat_topic-artificial-intelligence-en-gb","cat_topic-email-marketing-en-gb"],"acf":[],"_links":{"self":[{"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/guides\/137825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/guides"}],"about":[{"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/types\/guides"}],"version-history":[{"count":5,"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/guides\/137825\/revisions"}],"predecessor-version":[{"id":137845,"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/guides\/137825\/revisions\/137845"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/media\/239796"}],"wp:attachment":[{"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/media?parent=137825"}],"wp:term":[{"taxonomy":"cat_industry","embeddable":true,"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/cat_industry?post=137825"},{"taxonomy":"cat_topic","embeddable":true,"href":"https:\/\/spotler.com\/en-gb\/wp-json\/wp\/v2\/cat_topic?post=137825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}