> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alpacarelay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrations overview

> Connect the platforms you already run on — your email service provider for sending, and Square for your customer and booking data.

AlpacaRelay connects to the platforms you already run on, in two directions: it exchanges designs with the **email service provider** you send from, and it pulls **customer and booking data** in from Square.

## Send through your ESP

AlpacaRelay is where you design emails. Your ESP is where you send them. An integration connects the two, so a design never has to travel as a copied-and-pasted blob of HTML.

Designs move both ways:

<Columns cols={2}>
  <Card title="Import" icon="arrow-down-to-line">
    Pull a template that already lives in your ESP into AlpacaRelay, then edit it like any other email.
  </Card>

  <Card title="Export" icon="arrow-up-from-line">
    Push a finished AlpacaRelay email into your ESP as a template, and re-sync it whenever you change the design.
  </Card>
</Columns>

### Supported providers

<CardGroup cols={2}>
  <Card title="Mailchimp" icon="mailchimp" href="/integrations/mailchimp">
    Connects with OAuth. Exports a saved template.
  </Card>

  <Card title="Klaviyo" icon="https://mintcdn.com/alpacarelay-2b28e4cc/jDUOBDdUuSZjHTmq/images/providers/klaviyo.svg?fit=max&auto=format&n=jDUOBDdUuSZjHTmq&q=85&s=5d961de7310d6e83ae185a23660bdf8f" href="/integrations/klaviyo" width="1541" height="1032" data-path="images/providers/klaviyo.svg">
    Connects with OAuth. Exports an HTML template.
  </Card>

  <Card title="SendGrid" icon="https://mintcdn.com/alpacarelay-2b28e4cc/jDUOBDdUuSZjHTmq/images/providers/sendgrid.svg?fit=max&auto=format&n=jDUOBDdUuSZjHTmq&q=85&s=493a031eb22a1efdf23a7d7bfcd29ea3" href="/integrations/sendgrid" width="64" height="64" data-path="images/providers/sendgrid.svg">
    Connects with an API key. Exports a dynamic template.
  </Card>

  <Card title="Postmark" icon="https://mintcdn.com/alpacarelay-2b28e4cc/jDUOBDdUuSZjHTmq/images/providers/postmark.svg?fit=max&auto=format&n=jDUOBDdUuSZjHTmq&q=85&s=45c6fea93ed1336633049aeb6bbb244c" href="/integrations/postmark" width="30" height="30" data-path="images/providers/postmark.svg">
    Connects with a server token. Exports a standard template.
  </Card>
</CardGroup>

| Provider  | How you connect              | Export creates                   | Import available              |
| --------- | ---------------------------- | -------------------------------- | ----------------------------- |
| Mailchimp | OAuth — sign in to Mailchimp | A saved template                 | Yes                           |
| Klaviyo   | OAuth — sign in to Klaviyo   | An HTML template                 | Yes                           |
| SendGrid  | API key                      | A dynamic transactional template | Yes — dynamic templates only  |
| Postmark  | Server API token             | A standard template              | Yes — standard templates only |

<Note>
  You keep your own ESP account and your own sending. AlpacaRelay never sends your campaigns through your ESP — it reads and writes templates, nothing else.
</Note>

### Connect a provider

Connections belong to the workspace, not to you personally. Once someone connects Mailchimp, everyone in the workspace can push emails to it.

<Steps>
  <Step title="Open Connected apps">
    Click your workspace name, then **Settings** → **Connected apps**.
  </Step>

  <Step title="Pick a provider">
    Click **Connect app** and choose your provider.
  </Step>

  <Step title="Authorize">
    Mailchimp and Klaviyo open their own sign-in page, where you approve access. SendGrid and Postmark ask for an API key instead — the provider pages explain which key to create and where to find it.
  </Step>

  <Step title="Confirm it worked">
    The provider appears in your connected apps list with a **Connected** badge and the account name it resolved.
  </Step>
</Steps>

<Info>
  **Connected apps** is limited to workspace owners. If you don't see it in Settings, ask an owner to connect the provider for you — you'll still be able to import and export once they have.
</Info>

You can connect all four providers at once, but only **one account per provider per workspace**. To point AlpacaRelay at a different Mailchimp account, disconnect the current one first.

### Export an email to your ESP

<Steps>
  <Step title="Save your email">
    Export pushes the last **saved** version of a design, not unsaved edits in the editor. Save before you push.
  </Step>

  <Step title="Open Send to app">
    In the editor, open the dropdown next to the email's name and choose **Send to app**. From the emails list, use the **⋯** menu on the email's card.
  </Step>

  <Step title="Create the template">
    Each connected provider gets a row. Click **Create template** to push the design.
  </Step>

  <Step title="Re-sync after changes">
    Come back to **Send to app** and click **Re-sync**. The same template in your ESP is updated in place — the template ID never changes, so campaigns and automations already pointing at it pick up the new design.
  </Step>
</Steps>

#### How the link works

The first export creates a link between one AlpacaRelay email and one template in that provider. That link is what makes **Re-sync** update instead of duplicate.

<AccordionGroup>
  <Accordion title="One email links to one template per provider">
    The same email can be linked to Mailchimp and Klaviyo at the same time — one template in each. It can't be linked to two Mailchimp templates.
  </Accordion>

  <Accordion title="Duplicating an email does not copy the link">
    A duplicate starts unlinked. Its first **Create template** makes a brand-new template in your ESP, leaving the original's template untouched. This is deliberate — it lets you fork a design without overwriting what's already live.
  </Accordion>

  <Accordion title="Unlink leaves the ESP template alone">
    **Unlink** only forgets the connection on the AlpacaRelay side. The template stays in your ESP exactly as it was. The next **Create template** makes a new one.
  </Accordion>

  <Accordion title="Deleting the email leaves the ESP template alone">
    Deleting an AlpacaRelay email removes its links. Nothing is deleted in your ESP.
  </Accordion>

  <Accordion title="If you delete the template in your ESP">
    The next **Re-sync** notices it's gone, drops the stale link, and creates a fresh template instead of failing permanently.
  </Accordion>
</AccordionGroup>

#### Export status on email cards

Cards in your emails list carry a small badge so you can see sync state without opening anything:

| Badge          | Meaning                                                                 |
| -------------- | ----------------------------------------------------------------------- |
| Green check    | The latest saved version has been exported to that provider             |
| Amber warning  | You've changed the email since the last export. Click the badge to sync |
| Download arrow | This email was imported from that provider                              |

### Import a template from your ESP

<Steps>
  <Step title="Start a new email">
    From the emails list or the new-email screen, click **Import**.
  </Step>

  <Step title="Choose a provider">
    Your connected providers are listed under **Integrations** in the modal's sidebar, alongside **Upload file** and **Paste code**.
  </Step>

  <Step title="Pick a template">
    Browse the templates in that account and select one. Some providers group templates into views — use the view switcher to move between them.
  </Step>

  <Step title="Import and edit">
    The template's HTML is converted into an editable AlpacaRelay email. From there it behaves like anything else you've designed.
  </Step>
</Steps>

<Warning>
  Not every template can be imported. Templates that don't expose usable HTML — layouts, wrappers, and drag-and-drop templates the provider only renders internally — appear greyed out with the reason on hover. Turn on **Hide unavailable templates** to filter them out.
</Warning>

Imported templates keep the provider's own placeholder syntax as literal text. AlpacaRelay doesn't interpret `{{ first_name }}` or similar tags, so they survive the round trip unchanged.

### Connection states

| Badge               | What it means                                                                    | What to do                           |
| ------------------- | -------------------------------------------------------------------------------- | ------------------------------------ |
| **Connected**       | Working normally                                                                 | Nothing                              |
| **Needs attention** | A call to the provider failed authentication — usually revoked or expired access | Click **Reconnect**                  |
| **Disconnected**    | Someone disconnected it                                                          | Click **Connect** to set it up again |

Reconnecting is the same flow as connecting. Your existing email-to-template links survive it, so **Re-sync** keeps updating the same templates afterwards.

Disconnecting revokes AlpacaRelay's access to that account. It does not touch any template already in your ESP.

### Troubleshooting ESP connections

<AccordionGroup>
  <Accordion title="Send to app says the email has no content">
    The email has never been saved with content. Add something to the design, save, then push.
  </Accordion>

  <Accordion title="The provider isn't in my Send to app list">
    It hasn't been connected for this workspace yet. An owner needs to add it under **Settings** → **Connected apps**.
  </Accordion>

  <Accordion title="Export fails right after it worked">
    Access was probably revoked on the provider's side — a rotated API key, or a removed OAuth app. The connection flips to **Needs attention**; reconnect and try again.
  </Accordion>

  <Accordion title="My re-sync created a second template">
    The linked template was deleted in your ESP, so AlpacaRelay made a new one. Repoint any campaign that referenced the old template.
  </Accordion>
</AccordionGroup>

## Bring in your customer data

Square is a different kind of integration: data flows **in**, not out. Connecting it syncs your customers, orders, payments, refunds, and appointments into AlpacaRelay, so you can see your business at a glance and email the people in it.

<Card title="Square" icon="https://mintcdn.com/alpacarelay-2b28e4cc/jDUOBDdUuSZjHTmq/images/providers/square.svg?fit=max&auto=format&n=jDUOBDdUuSZjHTmq&q=85&s=8a5ce8433e15f363b917bf7b7b316e10" href="/integrations/square" width="30" height="30" data-path="images/providers/square.svg">
  Sync customers, appointments, and purchase activity — then import your customers as contacts.
</Card>

Square never receives your designs and never sends your email. It's a source of people and activity to send *to*.
