Previous Step — Step 8 — Accessing Subscription-Specific Analytics Within the sticky.io Subscriptions App for Shopify

sticky.io's partner integration with Klaviyo allows merchants to configure transactional emails, marketing emails and custom email flows. This article will provide you with an overview of the different transactional events that can be used to trigger email notifications, a list of the values sent to Klaviyo when your chosen event-based triggers are enabled and a step-by-step walkthrough for configuring email notifications for your Shopify store.

Without further ado, let's begin!


Email Event Contexts

There are seven total subscription-specific events that can trigger a transactional email or marketing email flow in Klaviyo.

  • Subscription reminder (upcoming rebill)

  • Expired card

  • Subscription cancelled

  • Subscription paused

  • Subscription resumed

  • Rebill success

  • Rebill decline


How Email Events Work

When one of the supported subscription trigger events is enabled within the sticky.io Subscriptions application, it allows sticky.io to send specific subscription-related information to Klaviyo when the event occurs. These events allow you to create Klaviyo Flows and Email Templates with information personalized to each consumer. This supports both transactional and marketing-related email notifications to your consumers.

The following customer information is passed with each subscription event, which can be used within the email template body:

const body = {
SubscriptionID: subscriptionContractNumberID,
MerchantID: store_id,
SourceID: SOURCE_ID,
CustomerID: subscriptionContract.customer.id,
EventType: event_type,
ProdivderType: config.ESP_PROVIDER_TYPE,
Credentials: {
PublicApiKey: espPublicKey,
},
CustomerProperties: {
$email: subscriptionContract.customer.email,
$first_name: subscriptionContract.customer.firstName,
$last_name: subscriptionContract.customer.lastName,
$phone_number: subscriptionContract.customer.phone,
$address1: subscriptionContract.customer.addresses[0].address1,
$address2: subscriptionContract.customers.addresses[0].address2,
$city: subscriptionContract.customer.addresses[0].city,
$zip: subscriptionContract.customer.addresses[0].zip,
$region: subscriptionContract.customer.addresses[0].provinceCode,
$country: subscriptionContract.customer.addresses[0].countrycodeV2,
},
Properties: {
subscription_id: subscriptionContractNumberID,
product_quantity: subscriptionContract.lines.edges[0].node.quantity,
product_id: subscriptionContract.lines.edges[0].node.productId,
product_name: subscriptionContract.lines.edges[0].node.title,
billing_model_name:
subscriptionContract.lines.edges[0].node.sellingPlanName,
days_until_rebill: getNumberOfDays(subscriptionContract.nextBillingDate),
next_recurring_date: subscriptionContract.nextBillingDate,
next_recurring_amount:
subscriptionContract.lines.edges[0].node.lineDiscountedPrice.amount,
member_portal_link: createLink(
store_id,
subscriptionContractNumberID,
subscriptionContract.customer.email,
subscriptionContract.customer.id
),
next_recurring_quantity:
subscriptionContract.lines.edges[0].node.quantity,
...(decline_reason && { decline_reason }),
},

Every event is sent with a URL so that you can create a call-to-action in the email template body that drives the consumer to their specific subscription into the consumer portal. This link is one of the fields that is passed as a part of the event-specific properties.


How to Configure Transactional Email Notifications in sticky.io Subscriptions

Now we will walk through the steps to configure email notifications within the sticky.io Subscriptions app for Shopify:

1 - Obtain your public API key (or site ID) from Klaviyo. It is a short alphanumeric value which is a unique identifier for your Klaviyo account.

Retrieve your public API key by logging into your Klaviyo account, then navigate to your profile (top right corner of the screen) and open the Account menu.

From here, navigate to Settings on the horizontal navigation bar and then to API Keys.

Here, you'll be presented with your Public API Key or Site ID.

For additional instructions on how to retrieve your Public API Key from Klaviyo, please reference this article within Klaviyo's help center documentation.

2 - Once you have obtained your Public API key, copy it to your clipboard.

3 - Return to the sticky.io Subscriptions app in Shopify and navigate to the Notifications tab.

4 - Once you've selected this tab, the top box on the page will be titled Email Service Provider Settings.

5 - Ensure that Klaviyo is selected from the Provider drop-down. Paste your API key into the Public API Key / Site ID field and click Save.

6 - Turn on your desired events in the sticky.io Subscriptions app using the toggles within the Subscription Notification Settings field. Toggling on a given event will ensure that the sticky.io Subscriptions app sends the event trigger to Klaviyo. Please note that if you configure an email flow that uses a given event but you have the event toggled Disabled in sticky.io Subscriptions, the flow will not proceed. By default, all email events are toggled to Enabled.

For Subscription Reminder emails, you, as the merchant, can customize the timing of your fired emails relative to the consumers next billing event. For example, to set subscription reminders for 1 day and 7 days before the subscription renewal, simply type 1,7 into the corresponding field. Click Save to preserve your selections.

7 - Configure your email flows in Klaviyo.

While logged into your Klaviyo account, navigate to the Flows tab.

Once loaded, click Create Flow in the upper right hand corner of the screen and then Create From Scratch.

An overlay will appear, prompting you to input the name of your email flow and any corresponding tags. We recommend you choose a simple, recognizable name for your email flow. An example name for a Subscription Created flow is listed below.

Click Create Flow to preserve your selections.

To begin, you'll need to select a Trigger for your email flow. Every subscription-specific event has a corresponding event in Klaviyo.

On the left-hand side of the screen, select Metric and choose the event of interest.

When the specified event occurs, sticky.io will send the customer record to this flow.

If you do not see your event / metric of interest, it is possible that your sticky.io representative still needs to enable your email events. Contact your sticky.io representative for assistance (see step 7 of this walkthrough)

For more information, please reference these articles from the Klaviyo help center. For additional support in configuring your email flows with Klaviyo, please contact the Klaviyo support team directly.

8 - Once your email is properly placed, click into the email from the flow by clicking the three horizontal dots in the Email card.

From here, you'll be able to make changes to the body of the email by clicking Configure Content.

This will redirect us to Klaviyo's email builder.

Here, you can alter the Sender name, Sender email address, Subject line and Preview text for your email of interest.

Next, choose how you would like to design your email. For today's example, we will choose Drag and Drop.

Choose your desired email template. For today's example, we will choose Basic. From the available options, we will choose 1 Column.

Here, you'll be able to edit your email template.

Example emails, including event-specific tokens, for each of the relevant contexts can be found below in the Email Event Contexts section. To edit the body of your email, select the text block by clicking directly on it.

Apply your edits by simply copy-pasting in the desired email copy into the desired text block.

Once satisfied with your selections, click Save Content in the upper right-hand corner of the screen.

You'll be redirected back to your created email flow.

Next, click Review and Turn On. An overlay will appear prompting you to specify if it is live or manual. Set your flow to Live and click Turn On.

For more information on configuring email templates, please reference these articles from the Klaviyo help center.

For further support in building your email templates or for best practices, please contact the Klaviyo support team directly.

9 - All transactional email flows must be reviewed and approved by the Klaviyo support team. Contact Klaviyo support to have your transactional email flows reviewed by their team. This additional step is not relevant for marketing email flows.


Email Event Contexts

There are seven total subscription-specific events that can trigger a transactional email or marketing email flow in Klaviyo.

  • Subscription reminder (upcoming rebill)

  • Expired card

  • Subscription cancelled

  • Subscription paused

  • Subscription resumed

  • Rebill success

  • Rebill decline


Expired Card

This can be used to notify the consumer when a new subscription chain has been started.

  • Event Name: “Expired Card"

Here is an example email template for the "Expired Card" event.

Dear {first_name} {last_name},

This email is to inform you that your card on file has expired. Please log into your account and update your payment information here:

{link to update billing info in member portal}


Subscription Reminder (Upcoming Rebill)

This can be used to remind the consumer of an upcoming rebill event for their existing subscription. You as the merchant can define how many times and how many days before the rebill these reminders are sent. Up to five total reminders can be configured.

For example, you can configure your notifications to remind the consumer 7 days and 3 days before their next rebill.

Add additional reminders by clicking the Add additional reminder button and entering your desired number of days prior to the event.

  • Event Name: “Subscription Reminder”

Here is an example email template for the "Subscription Reminder" event.

Dear {{ first_name }} {{ last_name }},

This is a reminder that the next billing date for your subscription is approaching. On

{{ event.next_recurring_date }} we will automatically withdraw

{{ event.next_recurring_amount }} plus shipping and tax from your account.

If you would like to modify your subscription, please log into your account and make any changes that you feel are necessary here:

{{ event.member_portal_link }}


Rebill Success

This can be used to notify the consumer of a successful rebill.

  • Event Name: “Rebill Success”

Here is an example email template for the "Rebill Success" event.

Dear {{ first_name }} {{ last_name }},

This email is to inform you that we have successfully charged your card for {{ event.product_name }}.

If you would like to make any changes, please log into your account here:

{{ event.member_portal_link }}


Rebill Decline

This can be used to notify the consumer of a failed rebill transaction.

  • Event Name: “Rebill Decline”

Here is an example email template for the "Rebill Decline" event.

Dear {{ first_name }} {{ last_name }},

This email is to inform you that we attempted to charge your account but it resulted in a decline for the following reason: {{ event.decline_reason }}.

If you would like to update your card on file, please log into your account here:

{{ event.member_portal_link }}


Subscription Paused

This can be used to notify the consumer of a successfully paused subscription chain.

  • Event Name: “Subscription Paused”

Here is an example email template for the "Subscription Paused" event.

Dear {{ first_name }} {{ last_name }},

This email is to inform you that your subscription has been paused.

If you would like to resume your subscription, please log into your account here:

{{ event.member_portal_link }}


Subscription Resumed

This can be used to notify the consumer of a successfully resumed subscription chain.

  • Event Name: “Subscription Resumed”

Here is an example email template for the "Subscription Resumed" event.

Dear {{ first_name }} {{ last_name }},

We would like to let you know that you subscription for {{ event.product_name }} has been resumed.

If you would like to modify your subscription, please log into your account and make any changes that you feel are necessary here:

{{ event.member_portal_link }}


Subscription Cancelled

This can be used to notify the consumer of a successfully cancelled subscription chain.

  • Event Name: “Subscription Cancelled”

Here is an example email template for the "Subscription Cancelled" event.

Dear {{ first_name }} {{ last_name }},

This email is to inform you that your subscription has been cancelled.

If you would like to reactivate your subscription, please log into your account here:

{{ event.member_portal_link }}


Congratulations! You're now an expert on configuring Klaviyo transactional emails within the sticky.io Subscriptions app for Shopify.

Next Step - Optional - Automatic Styling Customizations Applied to the Subscription Widget

Did this answer your question?