MARKETING PLAYBOOKS

Sending Back in Stock Product Alert Emails via Klaviyo

Back in Stock alert emails are an important addition to your list of event triggered campaigns. As we all unfortunately know, it’s your best products that tend to sell out first. Once the products come back in stock again, you have a great triggered marketing opportunity.

Prerequisites

  1. Swym Starter plan and above
  2. Klaviyo Email Account
  3. Swym-Klaviyo integration enabled

How To Implement

1. Enable Back-in-Stock alert Event

Before you get started, you need to make sure you’ve enabled the back-in-stock alert event within Swym Admin. To confirm, once you’ve logged in to Swym Admin, navigate to Integrations via the left nav.

Select Klaviyo to view the configuration settings. Click Configure next to “A product that a shopper was interested in is now back in stock”.

Select whether to notify all customers in a single batch or specify the notification according to customized batch settings as shown below.

You can select the number of customers to notify for every unit in stock and also the number of customers that can be notified within a particular batch. 

One can also customize the mails sent according to the newest or oldest requests that come up, along with the time delay between each batch of customers to be notified.

Once enabled, Swym will send an event to Klaviyo each time a product on a customer’s wishlist is back in stock.

A test trigger feature is also available that enables you to simulate Wishlist and Back in Stock events instantly, letting you check if the event triggers work as intended. Upon clicking the test trigger you will be prompted by a pop-up to enter an email address.

 

You can check if the test trigger has been sent by checking the same on Klaviyo which we will discuss in the next step.

2. Create Klaviyo Flow and Select Trigger

In Klaviyo, navigate to the Flows page and select “Create flow”. This will lead you to a new page where you need to select “Create from Scratch”. In this example, we’re going to call this flow “Back in Stock Alerts”.

Next, you’ll need to set the trigger for this flow. Choose “Your Metric” from the “Select a Trigger” section on the Right. Then you need to select the “API” option and choose the “Swym-backinstock” from the List of triggers in the API section. And then click on “Save”. Once done you will get a confirmation pop-up for the trigger. Click on “Confirm and Save” and the trigger is saved for the respective flow.

If you’re not seeing “Swym-backinstock” in your dropdown you probably haven’t had a wishlisted product come back in stock since you enabled the Klaviyo integration in Swym. Klaviyo will not display flow triggers until they’ve received at least one event. In this scenario, you can make use of our Test Trigger feature as discussed earlier.

 

After sending a test alert you can check it in Klaviyo under Analytics>Metrics>Swym-backinstock>Activity Feed.

In the Activity Feed, you will find the email address from which the sample alert was sent and the time at which it was sent.

Now, you need to go back to the flow created. Because the timing of this event isn’t driven by an action taken by the shopper, there’s likely no benefit to adding a time delay before the email is sent.

Next, add an email to your flow, this will be the first back-in-stock message.

3. Create Your Email Template

Tip: Klaviyo uses the 'Swym-backinstock'event for the Wishlist back in stock feature and for Back in Stock Alert subscriptions. For our users who have both the Swym apps installed (Wishlist Plus and Back in Stock Alerts), there is no way to differentiate this event between the two apps. We recommend using a more generic email content that applies to both your Wishlist Plus users and Back in Stock alert subscribers.

The next thing we’ll do is build an email template that consumes the back in stock data passed from Swym to create our triggered email campaign. 

Here are the event-level data elements included with the event which you can use to personalize your email template to fetch the details from the event payload sent to Klaviyo:

Data Element
Merge Tag
Example
What will this populate
UTC time of the event
{{ event.EventTime }}
2023-03-01T14:07:36Z
Time of subscription
Medium of the event
{{ event.Medium }}
sms
Medium that the subscriber has chosen
Product ID
{{ event.ProductId }}
42738631246058
Product ID of the item the shopper has subscribed to
Product Title/Name
{{ event.ProductName }}
Basic Logo Hoodie
Name/title of the product the shopper has subscribed to
Product Price
{{ event.ProductPrice }}
25
Price of the product the shopper has subscribed to
Product Quantity
{{ event.ProductQuantity }}
100
Quantity available of the product the shopper has subscribed to
Product Vendor/Brand
{{ event.ProductBrand }}
Swym
Vendor/brand that sells the product the shopper has subscribed to
Product Type
{{ event.ProductCategory }}
Apparels
Type of product the shopper has subscribed to
Product Variant ID
{{ event.VariantId }}
39419525955782
Product variant of the item the shopper has subscribed to
Variant Info/Details
{{ event.VariantInfo }}
Black
Details of the variant of the item the shopper has subscribed to
Variant SKU
{{ event.VariantSKU }}
SKU12345
Variant SKU of the product the shopper has subscribed to
Product URL
{{ event.ProductURL }}
https://demo.swym.it/products/copy-of-square-logo-hoodie?variant=39419525955782&swid=xVfoVkV Or__OsZ7xldBGV1BfZaQolJR9pUrjS2vE3R 0vVg0j9JfxlbOu0a-xgz7yAhIVYWxKALQMdOeykz6UesZxMlm gETaYRBcNjLM8u2hE9_OxYxq8CD-hfqunVn43&empi=7663771156714&epi= 42738631246058
URL of the product the shopper has subscribed to
Product Image URL
{{ event.ImageURL }}
https://cdn.shopify.com/s/files/1/0534/36 35/0662/products/smartmockups_kh3ht1 ld_1024x1024@2x.jpg?v=1616130049
Image of the product the shopper has subscribed to

Select the Email block in the flow and configure the Email details such as subject line and preview text as per your requirement. You can also update the Subject to include the name of the product, which we pulled in dynamically using {{ event.ProductName }}.

 

Now, scroll down, and go to the template section, and click on the “Select template” option

If you’ve been using Klaviyo for a while, you probably already have your own templates set up, or you can click on the “Create Blank Email” option. Hence, when it comes to email templates, you have two options::

  1. Create a template from Scratch
  2. Work on a pre-existing template. 

Option 1: To create a template from Scratch:

This will lead you to the email template editor page


Once the template editor is open you can add your logo to the top if you like or remove the image block. We’ll use the placeholder “text block” for the main message content as each back-in-stock event includes only one product at a time. For this example we’ll keep things simple, centering everything and using html to pull in data from the Swym-backinstock event.

Now, once you have added the Text block, you will have to work on the content section of the text block. For this please select the “Source Code ( </> )” option from the menu in the Left section.

Here’s the HTML we used for our simple template:

<p style="text-align: center;font-family:verdana,geneva,sans-serif;">The {{ event.ProductName }} you subscribed for is now back in stock!&nbsp;</p>&nbsp;
<p style="text-align: center"><img height="0" src="{{ event.ImageURL }}" width="400" /></p>
<p style="text-align: center"><a href="{{ event.ProductURL }}">{{ event.ProductName }}</a></p>

4. Preview the Message

Once you are satisfied with your template and have saved it, you can preview it to make sure everything is working as expected. Klaviyo lets you choose real example events that have flowed over for the preview, so the previews should expose any issues you might be experiencing. Click on the Done button on the content section and then Save the template.

We like to preview first in Klaviyo to make sure everything is working and then check it out in a real inbox. Here’s what our preview looked like:

Option 2: To work on a Pre-existing Template:

Select a pre-existing template from the template library. You can find a list of template type and layouts in the library. Select one as per your requirements and you can customize it later.

Once you have selected the template click on “Use Template” which will now lead you to the template editor page.

Every template will have a header block bar where you will find the store logo and few links. You can click on the header bar and either edit the links or remove them as per your customization needs from the section opened up in left. Here in the below example we have removed all the links from the header bar.

Now please click on the “Text block” as highlighted in the example below, and edit the texts to include the product details in the template. In the example below we have selected the first text block and have added the text for the restock product including the {{event.ProductName}} will fetch the product name of the respective restocked product here.

 You can use the same text if you wish:

Guess what? Your {{event.ProductName}} is back in stock now. Buy it before it is sold out again!

Now, to display the respective product image in the template you can click on the image block-> Click on the Replace option in the left section as highlighted on the example below. This will now open a pop-up to add the image on your image block. Select the Dynamic Image option as this will dynamically add the respective products to the template as per the events, and add the merge tag {{event.ImageURL}} to fetch the Product image. Once you have added the dynamic tag, click on Save.

Step 1:

Step 2:

You can also edit the button tab, and change the button label and link to the product URL by using the dynamic tag {{event.ProductURL}} as shown in the example below:

In the template we have used here, we also have another text block showing the price details. So we will move to the 2nd text block and replace the price with the dynamic merge tag to fetch the respective product price which is {{event.ProductPrice}} as shown in the example below and add the text as per your requirement

4. Preview the Message

Once you are satisfied with your template and have saved it, you can preview it to make sure everything is working as expected. Klaviyo lets you choose real example events that have flowed over for the preview, so the previews should expose any issues you might be experiencing. Click on the Done button on the content section and then Save the template.

We like to preview first in Klaviyo to make sure everything is working and then check it out in a real inbox. Here’s what our preview looked like:

Make your flow live

When you’re satisfied with your testing the last step is to set your email status from “draft” to “live”. Once that switch is flipped,, your emails for the Back in stock alerts should start flowing to the customers when the product they have subscribed for are restocked!