Klaviyo is the all-in-one email marketing platform for eCommerce. This tool has everything you need to run marketing campaigns and stay in touch with customers.
SendGrid is the leading delivery platform for transactional and marketing emails. SendGrid's technology enables companies to deliver emails, SMS & push notifications to their customers with maximum ease, reliability, and speed.
SendGrid IntegrationsIt's easy to connect Klaviyo + SendGrid without coding knowledge. Start creating your own business flow.
Triggers on a new event for any metric.
Creates a member.
Creates a member.
Adds a new subscriber to a list you specify. Profiles are single or double opted in based on the list's settings.
Updates an existing subscriber.
Creates or updates a contact.
Sends an Email.
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
First of all, Klaviyo is email marketing platform. It connects online stores with their customers through email. It helps online business owners to engage customers and achieve their goals in a more effective manner.
Klaviyo provides access to personalization tops, A/B testing, email automation and marketing attribution. It also allows you to find the best performing content and connect it with your customers.
On the other hand, SendGrid is a cloud-based email delivery service provider. It simplifies email delivery to increase user engagement and deliverability.
SendGrid provides reliable, scalable and cost-effective sputions for sending and receiving emails and protecting against spam and abuse. SendGrid also provides 24/7 support to its clients in case of any technical issues.
Klaviyo and SendGrid can be integrated without the assistance of a third party service provider. This integration can be done easily by anyone with an understanding of the syntax of the programming languages used by both these platforms. The integration is done on the Klaviyo side as well as on the SendGrid side.
The steps for integration on both the sides are explained below for your convenience:
Integration on the Klaviyo side:
Step 1. Log into Klaviyo account with your credentials.
Step 2. Navigate to “Settings” tab. In the “Merge Tags” section, click on “Add Merge Tag” button. A new window will open. Now enter the details of your SendGrid API Key and Merge Tag. You can find your API Key and Merge Tag under “Utilities” tab when you log into your SendGrid account. Once you have entered those details, click on “Create Merge Tag” button.
Step 3. In the same “Merge Tags” section, click on “Add Merge Tag” button again. This time enter your SendGrid username and passphrase in the respective fields and click on “Create Merge Tag” button once again.
Step 4. Go back to your dashboard and navigate to “Mail > Email Marketing > Rules”. Here you need to create a new rule by clicking on “+ New Rule” button. You can give a name of your choice to this rule but make sure that the name reflects what this rule will do. For instance, you can name it as “Filter Campaigns To Sendgrid” or “Filter Campaigns To Sendgrid For MailChimp Merge Tags” or simply “Sendgrid”. Finally, click on “Save Changes” button at the end of the page. You will now be asked to select a template that will be used to set up this rule. Select “New Template” option from the dropdown menu and click on “Make Default” button. As soon as you click on this button, your new template will become active and you can edit it by clicking on “Edit Template” link next to it on the left sidebar of that page.
Step 5. Now navigate to “Contacts > Contacts > All Contacts” from your left sidebar and select contacts one by one from your list of contacts to activate them for this rule. When you select a contact, there will be 3 options available at the bottom of the page as shown in the screenshot below. Click on “Mark as Active For This Rule (sendgrid)” option to activate that particular contact for this rule. Once you have activated all your contacts, click on “Save Changes” button at the bottom of that page and then go back to your rule settings page by clicking on “Back to Rules” link at the top right corner of that page.
Step 6. On your rule settings page, you will see that there is a new section called “Filter Logic” which will contain some basic rules by default which will be used for filtering out messages for your rule when needed. You need to add fplowing logic to this section. if (contains(subject, '[email protected]'). { set('merge_tag', '{{merge_tag}}'); } else { set('merge_tag', 'unsubscribe'); }
Here you have used two functions – contains(. and set(. However, you can use any function that is supported by Klaviyo by navigating to this link:[1] [2]. There are 2 possible ways in which you can use functions in Klaviyo rules. using shorthand notation or using long form notation (the latter is used in our example. Using shorthand notation looks like this. contains(<field>, <value>. where <field> indicates which field should be searched for <value> indicates which value should be searched for <value> is optional. If <value> is not specified in shorthand notation then it will search for any value present in <field>. This way only one function call is required but it has certain limitations such as it cannot search for values inside arrays or if statements etc.; hence we have used long form notation in our example where we have passed an array of values to contains(. function so that it can search for values inside arrays or if statements etc..
In our example, we have used only contains(. function but as mentioned earlier, you can use any function that is supported by Klaviyo; just make sure that you use it correctly after referring to their documentation.[3][4] You can find complete documentation here.[5] Sometimes there might be a situation where a merge tag value may be missing or empty because no message was sent out using that merge tag; so if you want to avoid such cases then you can check for the presence of merge tag value before setting merge tag to ‘unsubscribe’ value as fplows. if (set('merge_tag', 'unsubscribe'. || empty(set('merge_tag')). { set('merge_tag', '{{merge_tag}}'); } else { set('merge_tag', 'unsubscribe'); } The code above shows that if there is no merge tag value or if merge tag value is empty then merge tag should be assigned a value using set(. function and if merge tag value is not empty then merge tag value should be assigned a value using equals ()function; hence, in this case there would be no duplicates created since merge tags would only be assigned values if they were not assigned previously while step 6 described above would ensure that only emails with matching subject lines are filtered out for this rule and sent to SendGrid instead of all the emails that Klaviyo sends out for a given campaign.
That’s it! Once you have tested this rule for any errors then you can save changes to apply this rule for future campaigns. You do not need to create another rule for future campaigns as long as you maintain consistency for naming your campaigns because name of every campaign with which you use this rule will automatically become part of subject line of messages sent out from campaigns with same name so that this rule can be applied automatically without much effort from your part. Also make sure that there is no space between words in campaign name along with prefixes or suffixes attached with campaign name because they may create problems in applying this rule automatically without any changes being made manually. Name of campaigns along with their prefixes or suffixes are taken as a single string when applying this rule automatically, so if there is any space between words or letters in campaign name then it may cause issues while applying this rule automatically. However, if you want to change campaign names manually after they are sent out using this rule then you may find a small box (as shown in the screenshot below. with each campaign name right after campaign name under “Campaigns Sent Out” tab which will help you change campaign names manually for future campaigns whenever required:
Once you are done with setting up this rule then you will have successfully integrated Klaviyo with SendGrid! Now let us see how we can integrate SendGrid with Klaviyo…
The process to integrate Klaviyo and SendGrid may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.