# Automations

Source: https://gokarla.io/docs/guides/notify/automations

# Automations

Automations send one of your [email templates](/docs/guides/notify/email-flows)
to the customer automatically when a shipment, return, or claim event happens.
Karla evaluates and sends them itself, so you don't need Shopify Flow, an
external email tool, or any other integration in between.

In the [Karla Portal](https://portal.gokarla.io), go to
**Notify → Automations**.

:::note Automations, templates, or integrations?
An automation decides **when** an email goes out. The
[email template](/docs/guides/notify/email-flows) it points at decides
**what** the email says. If you'd rather send emails from an external tool
like Klaviyo or Brevo, use a
[Notify integration](/docs/guides/notify/integrations/klaviyo) instead — or
send templates from your own workflows with the **Send Karla email** action
in [Shopify Flow](/docs/platform/email-templates).
:::

## Before you start

- **Karla email sending is enabled** for your shop. It's a premium add-on —
  until it's enabled, the page shows a **Karla email sending** banner with a
  **Premium** badge. You can review existing automations, but you can't
  create, edit, or enable them. Use the **Contact us** button to get it
  enabled.
- You have at least one **active** email template. Automations can only
  point at active templates; with none, **New automation** is disabled and
  the page links you to **Create a template first**.
- You have the **editor** role (or above) in the portal.

| Role   | What you can do                               |
| ------ | --------------------------------------------- |
| viewer | See your automations                          |
| editor | Create, edit, enable, and disable automations |
| admin  | Everything above, plus delete automations     |

## Create an automation

1. Click **New automation**.
2. Give it a **Name**. Names must be unique within your shop.
3. Pick a **Trigger** — the event that fires it (see
   [Triggers](#triggers) below).
4. Pick the **Email template** to send. The list shows your active templates
   with their language.
5. Leave **Enabled** on to start sending right away, or switch it off to
   save the automation as a draft.
6. Optionally, add **Conditions** to narrow down when it fires (see
   [Conditions](#conditions)).
7. Click **Save automation**.

The email goes to the customer's email address on the order, and the
template's [variables](/docs/platform/email-templates#variable-reference) are
filled in from the event that fired it.

:::warning Avoid double emails
If the same event already sends an email from Klaviyo, Brevo, or another
integration, enabling an automation for it sends the customer two emails.
Turn off the other tool's flow for that event, or keep only one active.
:::

## Triggers

The **Trigger** list is grouped into three sections. Each shipment event maps
to exactly one trigger — a parcel left with a neighbour fires **Delivered to
neighbour**, not **Delivered**.

**Shipment** — events on the shipments you send to customers:

| Stage             | Triggers                                                                                                                                           |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Order             | **Order placed**, **Order cancelled**                                                                                                              |
| On the way        | **Pre transit**, **In transit**, **Out for delivery**                                                                                              |
| Delays and damage | **Carrier delay**, **Delayed due to customer request**, **Damaged**                                                                                |
| Delivery problems | **Delivery failed**, **Delivery failed address issue**, **Delivery failed forwarded to parcel shop**, **Delivery second attempt**                  |
| Delivered         | **Delivered**, **Delivered to neighbour**, **Delivered to letterbox**, **Delivered to parcel shop**, **Delivered to parcel locker**, **Picked up** |
| Sent back to you  | **Failed returned**, **Refused then returned**, **Not picked up then returned**                                                                    |

Each trigger is one of Karla's shipment event groups — **Delivered to
neighbour** is `shipment_delivered_to_neighbour`, and so on. To see which
carrier events belong to which group, look the group up in the
[shipment events catalogue](/docs/platform/events/shipments).

**Returns** — events on return shipments the customer sends back to you:
**In transit**, **Out for delivery**, **Carrier delay**, **Delivery failed**,
and **Delivered**. Every delivery-failure and delivery variant of a return
maps to the single **Delivery failed** or **Delivered** trigger.

**Claims** — **Claim created** fires once when a new claim is created.

## Conditions

Conditions are optional. Without any, the table shows **Always fires** and
the automation sends on every matching event. With conditions, **all** of
them must match (up to 20 per automation).

| Field                   | Available for                 | Value                                                                                             |
| ----------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------- |
| **Carrier**             | Shipment and Returns triggers | Karla's carrier reference, e.g. `dhl-germany` — the same value as the `carrier` template variable |
| **Destination country** | Shipment and Returns triggers | A two-letter country code from the order's delivery address, e.g. `DE`                            |
| **Claim reason**        | **Claim created**             | One of the Resolve claim reasons, e.g. **Damage**                                                 |

Each condition uses one of three operators: **equals** (a single value),
**is one of**, or **is not one of** (comma-separated lists of up to 50
values).

- If the event has no value for a field — for example, the order has no
  delivery country — the condition doesn't match and the automation doesn't
  fire. Nothing errors.
- Changing the trigger removes conditions that don't apply to the new one;
  the dialog tells you when that happens.

## How sending works

- **Every matching automation sends.** Automations are independent: if two
  enabled automations match the same event, the customer gets both emails.
- **Each automation sends once per shipment and trigger.** Repeated events
  never resend the same automation's email to the same shipment — including
  triggers like **Carrier delay** that can happen more than once.
- **Statuses only move forward.** Once an automation email has gone out for
  a status on a shipment, later events with that status don't send again,
  and an earlier status arriving late (like **In transit** after
  **Delivered**) is skipped. The shipment **Carrier delay**, **Damaged**, and
  **Delayed due to customer request** triggers are exempt from this rule.
- **Old events are skipped.** Karla only sends for shipment events that are
  less than 10 hours old (24 hours for **Delivered to parcel shop** and
  **Delivered to parcel locker**), so a late carrier update never triggers a
  stale email.
- **Claims send once per claim** — **Claim created** only fires when the
  claim is created.
- **Emails use your sender settings.** Automation emails go out with the
  same reply-to address and sender name as every Karla-sent email — and from
  [your own domain](/docs/guides/notify/sender-domain) if you've set one up.

These rules are tracked separately from Klaviyo, webhooks, and other
integrations — an email sent by an integration doesn't stop an automation
from sending, and vice versa.

## When an automation doesn't send

| Situation                                     | What happens                                                                                                                 |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| The automation is disabled                    | It's ignored. Events that happen while it's off aren't sent later.                                                           |
| Its template is inactive or was deleted       | The email is skipped. The table shows **Unknown template** for a deleted one; edit the automation to pick an active template |
| Karla email sending is disabled for your shop | The email is skipped, and the page is locked until sending is re-enabled                                                     |
| The order has no valid customer email address | The email is skipped                                                                                                         |

## Manage your automations

The **Your automations** table shows each automation's **Name**,
**Trigger**, **Conditions**, **Template**, and **Enabled** state. Use the
**Enabled** switch to pause or resume an automation, the pencil to edit it,
and the bin to delete it. Deleting is admin-only and can't be undone.

A shop can have up to **50 automations**.

## Related

- [Email templates](/docs/guides/notify/email-flows) — create the templates
  automations send.
- [Email templates reference](/docs/platform/email-templates) — the full
  variable list, and the Shopify Flow action.
- [Send from your own domain](/docs/guides/notify/sender-domain) — the
  custom sending domain on the enterprise tier.
