# Klaviyo Flows

With Klaviyo Flows, you can send emails using Klaviyo templates in response to Gift Card Factory events.

### Prerequisites

* [Klaviyo account connected with Gift Card Factory](https://docs.giftcardfactory.app/integrations/klaviyo/connect-klaviyo)

### Available Metrics

If selected, Gift Card Factory sends following events as metrics to Klaviyo:

* **Gift Card Factory - Bulk Send**: Sent anytime a gift card is created using [Bulk Operations - Bulk Send](https://docs.giftcardfactory.app/bulk-operations/bulk-send)
* **Gift Card Factory - Import From File**: Sent anytime a gift card is created using [Bulk Operations - Import From File](https://docs.giftcardfactory.app/bulk-operations/import-from-file)
* **Gift Card Factory - Rewards**: Sent when a gift card is created and sent through a [Gift Card Rewards](https://docs.giftcardfactory.app/campaigns/gift-card-rewards) campaign
* **Gift Card Factory - Refund:** Sent when a [Refund on Gift Card](https://docs.giftcardfactory.app/gift-card-refunds) is created.
* **Gift Card Balance Reminder:** Sent when gift card is created and sent through a [Gift Card Reminders](https://docs.giftcardfactory.app/campaigns/gift-card-reminders) campaign
* **GCP Gift Card Email:**  Sent to the recipient of a purchased gift card  ([Gift Card Postman](https://docs.giftcardfactory.app/campaigns/gift-card-postman))
* **GCP Gift Card Sender Email:** Sent to the sender of a purchased gift card ([Gift Card Postman](https://docs.giftcardfactory.app/campaigns/gift-card-postman))

### Creating a Klaviyo Flow

To create a Klaviyo Flow you need to follow these steps:

1. In Klaviyo navigate to Flows and create a new flow
2. Select a trigger
3. Add an action
4. Enable the flow
5. *(Optional)* Apply for transactional status

#### 1. Navigate to Klaviyo to create a new flow

Open the Klaviyo dashboard, then go to **Flows → Create Flow → Build Your Own**. You should then see a new screen where you can select the trigger.

#### 2. Select trigger

From the tabbed menu on the right, select **Your Metrics → API**.\
Now find the Gift Card Factory metrics for which you want to send emails.\
For the purpose of this guide, we will use **GCP Gift Card Email**. This metric is registered against a contact in Klaviyo whenever someone purchases a gift card for someone else.

<figure><img src="https://2895247924-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcsKliv3CuXU7kN4gxX9B%2Fuploads%2FAdUAL31E5fUuoc3PE6qG%2Fimage.png?alt=media&#x26;token=90a211da-f432-47d9-86da-9dbddc1778f2" alt=""><figcaption></figcaption></figure>

#### 3. Add action

From left hand side navigation select Email action. <br>

<figure><img src="https://2895247924-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcsKliv3CuXU7kN4gxX9B%2Fuploads%2FUeTJBuAJQOWLpzhLtUQ6%2Fimage.png?alt=media&#x26;token=6b5b8bd8-5b42-478a-88d0-0c7b5de23a6e" alt=""><figcaption></figcaption></figure>

Now you can configure all your email properties, such as:

* Subject
* Preview text
* Template

When editing the template, you can use any variables that were sent alongside the metric.

<figure><img src="https://2895247924-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcsKliv3CuXU7kN4gxX9B%2Fuploads%2Fqa5o4yORBcMV9CXGkv8R%2Fimage.png?alt=media&#x26;token=19472a73-1887-4f6f-963b-2e7ded4762b0" alt="" width="375"><figcaption></figcaption></figure>

#### 4. Enable flow

Now you can enable your newly created flow. Click the **button** in the top-right section. Whenever Gift Card Factory sends the metric, the email will be sent to the contact who received the metric.

#### 5. (Optional) Apply for transactional status

By default, Klaviyo considers all emails sent through flows as marketing emails. To send transactional emails, you need to apply for a review. To apply for transactional status, select your Email action and, on the right panel, select the **Apply for transactional status** checkbox.<br>

<figure><img src="https://2895247924-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcsKliv3CuXU7kN4gxX9B%2Fuploads%2FvykOUUzKw6oFIwwALfAk%2Fimage.png?alt=media&#x26;token=cb992835-50e7-4c0a-8569-63f0559f5493" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
It might take up to few hours for the status to be approved.
{% endhint %}

***

### Additional resources

* [Builing Klaviyo Flows](https://help.klaviyo.com/hc/en-us/articles/115002774932)
