# Connect a sending identity
Source: https://alpacarelay-2b28e4cc.mintlify.app/get-started/connect-a-sending-identity
Connect a Gmail account so AlpacaRelay can send campaigns as you.
A sending identity is the account your campaigns go out from — the address recipients see in their inbox. AlpacaRelay never sends from a shared address of ours, so you connect your own.
You only need this to **send campaigns from AlpacaRelay**. Designing emails, previewing them, exporting the HTML, and pushing designs to [your own ESP](/integrations/overview) all work without one.
## What you can connect
Gmail, over Google sign-in. That's the one option today — there's no SMTP or custom-domain setup yet.
Sending from your own domain is a common ask and isn't supported yet. If you need `hello@yourcompany.com` as the visible sender, the practical route today is to design in AlpacaRelay and send through [an ESP you've already set up](/integrations/overview).
## Connect Gmail
Click your workspace name, then **Settings** → **Connected apps**.
Click **Connect app** and pick **Gmail**. You'll be asked to confirm, then a Google window opens — allow the popup.
Sign in as the Gmail account you want to send from and approve the request.
Gmail appears in your connected apps, showing the address it resolved and a **Connected** badge. That address is read from Google directly, so what you see is genuinely the mailbox you'll send from.
**Connected apps** is only visible to workspace owners. If it isn't in your Settings, ask an owner to connect the account — everyone in the workspace can then send using it.
### What AlpacaRelay can and can't do with your Gmail
The connection requests a single Gmail permission: **send email on your behalf**.
| Can | Can't |
| ----------------------------- | ----------------------------------------- |
| Send messages as your address | Read, search, or open any of your mail |
| — | See your drafts, labels, or contacts |
| — | Delete or modify anything in your mailbox |
There is no read permission in the request at all, so mailbox access isn't a matter of policy — it's not technically possible with the access you grant.
## Connect more than one
You can connect several Gmail accounts to one workspace and choose which a campaign sends from. The same address can't be added twice.
This is how you keep, say, `news@` and `founders@` separate without switching workspaces.
## Use it
Once connected, pick the sending account when you set up a campaign under **Campaigns**. A campaign won't send without one — you'll get **Connect and select a sending account** if you try.
Test emails don't need a connected identity. You can check how an email lands in a real inbox before setting any of this up.
## Sending rate
Campaigns are paced deliberately rather than blasted: roughly **one email every three seconds**, up to about **400 per day**.
That means a 400-recipient campaign takes around twenty minutes of steady sending, and a larger audience spills into the following day. When you set a campaign up, the recipient estimate tells you in advance if the audience won't clear in one day.
Your Google account's own limit applies on top of this — a few hundred messages a day on personal Gmail, higher on Workspace. Whichever limit is lower is the one you'll hit.
## Disconnect
**Disconnect** on the Gmail row removes the identity and revokes AlpacaRelay's access at Google in one step. Nothing is left behind holding a token.
Check your campaigns first. A scheduled campaign pointing at a disconnected identity fails rather than falling back to another one. Reconnecting creates a fresh identity, so you'll need to select it on any campaign that referenced the old one.
You can also remove access from your Google account's [connected apps](https://myaccount.google.com/permissions) at any time. Do that and sending stops immediately — AlpacaRelay finds out when a send fails, so disconnecting here is the tidier path.
## Troubleshooting
It was blocked as a popup. Allow popups for AlpacaRelay and click **Connect** again — the click itself is what permits the window to open.
It's owner-only. Ask a workspace owner to connect the account.
Either nothing is connected, or the campaign doesn't have an account chosen. Both live in the campaign's setup.
The identity was probably disconnected, or access was revoked at Google. Reconnect, then select the new identity on the campaign.
That's the pacing described above, not a stall. Steady sending protects your address's reputation far more than speed helps you.
# Create your first email
Source: https://alpacarelay-2b28e4cc.mintlify.app/get-started/create-your-first-email
Describe an email, refine it by chatting, check its score, and get it out — in about five minutes.
This walks through one email end to end: describing it, refining it, checking it, and getting it somewhere you can send from.
## Before you start
You need an AlpacaRelay account and a workspace. Signing up creates both — you'll be asked for your name, role, and industry along the way, which is what lets the first email land closer to your kind of business.
Nothing else needs setting up. You don't need to connect a sending provider or add contacts to design an email.
## Describe the email
Click **New email** at the top of the sidebar. You'll get a prompt box: *Tell me what you need, and I'll make the email for you…*
Write it the way you'd explain it to a colleague. One or two sentences is plenty.
```text theme={null}
A launch email for our new analytics dashboard. Aimed at existing
customers on the free plan. Friendly, not salesy — one clear button
to start a trial.
```
If you'd rather not start from a blank box, pick one of the suggestions below it and edit from there.
The email is built while you watch — structure first, then copy and styling. It costs one credit.
When it finishes you land in the editor, with your email on the canvas and the chat beside it.
Detail in the prompt is worth more than detail in follow-ups. Who it's going to, what you want them to do, and the tone you want are the three things that change the result most.
### Already have an email you want to reuse?
Click the **+** button in the prompt box to **Import email** instead. You can upload an HTML file, paste HTML, or pull a template from a [connected provider](/integrations/overview). It's converted into an editable AlpacaRelay email — same editor, same everything from here on.
## Refine it
You now have two ways to change the email, and they work on the same design.
Best for anything structural or wholesale: rewriting copy, changing layout, adding a section.
Best for the specific and small: fixing a word, nudging spacing, changing one button's color.
Requests that work well in chat:
```text theme={null}
Make the headline shorter and punchier.
Add a three-column section for the key features.
Swap the button and the image — button first.
Use a warmer tone throughout.
```
Each AI change costs a credit. Editing by hand costs nothing, so for small fixes it's both faster and cheaper to click into the text and type.
Name your colors in the prompt — *"use #1F6FEB for buttons and headings"* — and the design comes back closer to your look from the start. It saves a round of corrections.
The **Styles** panel handles the email as a whole: background color, content width, and padding. Everything else is per-block — click any element on the canvas to restyle it.
## Check it before it goes anywhere
Open **Quality score** in the left toolbar. You get a score with the reasoning behind it, broken down across the things that actually affect whether an email works — deliverability, engagement, and how it renders across clients.
Treat the recommendations as a list to work through, not a grade to chase. Each one names a specific change, and you can ask the chat to make it: *"apply the recommendation about the subject line."*
Then hit **Preview** and check it on both desktop and mobile. Most layout problems are only visible at phone width.
## Save, and how versions work
Click **Save**. From then on the design is safe, and **Save** is also what export and sending read from — they use the last saved version, never unsaved edits on your screen.
Versions record intent rather than keystrokes:
| What you do | What happens |
| -------------------------- | --------------------------- |
| The AI changes the email | A new version |
| You save a snapshot | A new version |
| You type, restyle, or drag | Updates the current version |
That means **History** stays readable — a handful of meaningful states rather than hundreds of autosaves. You can switch back to any of them, and mark one as stable so it can't be edited over by accident.
## Get it out
Two paths, depending on where you send from.
Open the dropdown next to the email's name and choose **Send to app**, then **Create template** on your provider. The design lands in Mailchimp, Klaviyo, SendGrid, or Postmark as a template you can build a campaign from.
Change the design later and **Re-sync** updates the same template in place. See [Integrations](/integrations/overview).
Add contacts under **Audience**, build a segment, then create a campaign under **Campaigns**. You'll need a [connected sending identity](/get-started/connect-a-sending-identity) first — that's the only prerequisite.
**Export** gives you the rendered HTML — download it, grab it as a zip, or copy it to the clipboard. Free workspaces get a limited number of exports.
## Where to go next
Connect the platform you send from, so designs move without copy-paste.
Pull your customers and bookings in, and turn them into contacts you can email.
## Troubleshooting
Say what's wrong in chat rather than starting over — it's one credit either way, and the AI has the current design as context. If it's badly off, a fresh, more specific prompt usually beats a chain of corrections.
Hand-editing, previewing, scoring, exporting, and sending all still work — only AI generation needs credits. Add more from **Settings** → **Billing**.
Export reads the last saved version. Save, then **Re-sync**.
Open **History** and switch to it. Nothing is deleted by switching, so you can move back and forth freely.
# Welcome to AlpacaRelay
Source: https://alpacarelay-2b28e4cc.mintlify.app/index
Design email by describing it. AlpacaRelay writes the design, scores it, and hands it to whatever you send with.
AlpacaRelay is an email design tool you talk to. Describe the email you need, and it produces a complete, responsive design — copy, layout, and styling — ready to send.
From there you can keep editing by chatting, or drag things around by hand. Both work on the same email.
The five-minute version: describe an email, refine it, and get it out.
## What you can do
Describe the email in plain language. Refine it by asking for changes rather than hunting for settings.
Drag, restyle, and rewrite directly on the canvas when you'd rather do it yourself.
Every email gets a quality score with specific, actionable fixes — not a pass or fail.
Send campaigns to your own contacts, or push the design into Mailchimp, Klaviyo, SendGrid, or Postmark.
## How it fits together
AlpacaRelay covers the path from idea to inbox, and you can get off at any point:
Describe the email, or import one you already have, then refine it by chatting or by editing the canvas directly.
Read the quality score, act on the recommendations, and preview on desktop and mobile.
Either build an audience and send the campaign from AlpacaRelay, or export the design to the platform you already send from.
You don't have to adopt all of it. Plenty of people use AlpacaRelay purely as a design tool and keep sending from their existing provider — that's what the [ESP integrations](/integrations/overview) are for.
## Find your way around
Start here if you've just signed up.
Connect the platform you send from, or pull your customer data in from Square.
## Credits and plans
Asking the AI to generate or change an email costs **one credit**. Editing by hand, previewing, and scoring don't — you only spend a credit when the AI does work for you.
New workspaces start with a free allowance, so you can try the whole flow before deciding anything. Paid plans add credits, lift the export limit, and let you send campaigns from AlpacaRelay. Current plans and prices are on [alpacarelay.com](https://alpacarelay.com).
Credits belong to the workspace, not to you personally. Everyone you invite draws from the same balance.
## Get help
Stuck on something these docs don't cover, or found something here that's wrong? Reach us at [support@alpacarelay.com](mailto:support@alpacarelay.com) or in our [Discord](https://discord.gg/fq6mtPaQNE).
# Klaviyo
Source: https://alpacarelay-2b28e4cc.mintlify.app/integrations/klaviyo
Connect Klaviyo with OAuth to import your existing templates and push AlpacaRelay designs back as HTML templates.
Connecting Klaviyo lets you import templates from your Klaviyo account and push AlpacaRelay designs back out as HTML templates you can use in campaigns and flows.
New to integrations? The [overview](/integrations/overview) explains the import and export flows that are the same for every provider. This page covers what's specific to Klaviyo.
## What you need
* A Klaviyo account you can sign in to.
* Permission to authorize apps on that account.
Klaviyo connects with OAuth, so you sign in and approve access rather than pasting a key.
Don't use a Klaviyo private API key. Private keys are account-wide secrets with far broader access than this integration needs, and AlpacaRelay's connection flow doesn't accept them. Use the OAuth flow below.
## Connect Klaviyo
Go to **Settings** → **Connected apps**, then click **Connect app**.
Klaviyo's authorization page opens. If you see a form asking for an API key instead, stop — that isn't the intended flow. Reach out to support.
Klaviyo shows exactly what you're granting:
| Permission | Why it's needed |
| --------------- | ------------------------------------------------------------------- |
| Read accounts | Confirms the connection works and shows which account you connected |
| Read templates | Lists your templates so you can import them |
| Write templates | Creates and updates templates when you export a design |
AlpacaRelay asks for nothing beyond these — no profile, list, segment, or campaign access.
Klaviyo appears in your connected apps with a **Connected** badge and your Klaviyo company name.
If AlpacaRelay later adds Klaviyo features that need more access, you'll be asked to reconnect. Klaviyo permissions are fixed at the moment you authorize — a connection made today never silently gains new access.
## Export a design to Klaviyo
Save the email, then open **Send to app** from the editor's name dropdown or the **⋯** menu on an email card, and click **Create template** on the Klaviyo row.
The design is pushed as an **HTML template** — Klaviyo's code-based template type, not a drag-and-drop one. That's what preserves the design exactly as you built it. You can use it in a campaign or a flow email like any other Klaviyo template.
**Re-sync** updates the same template in place, so flows already pointing at it pick up the new design.
Because the export is an HTML template, editing it inside Klaviyo's drag-and-drop editor isn't available — Klaviyo opens it in its code editor. Make design changes in AlpacaRelay and re-sync, rather than editing on both sides.
## Import a template from Klaviyo
Click **Import** when creating an email, choose **Klaviyo** under **Integrations**, and pick a template.
Klaviyo has no folders or tags for templates, so the picker groups them by editor type instead. HTML and code-based templates import most reliably. Klaviyo's API doesn't expose template thumbnails, so rows show names without previews.
Where Klaviyo doesn't return raw HTML for a template, AlpacaRelay renders the template first and imports the result. Templates it can't produce usable HTML for at all are greyed out with the reason on hover.
Klaviyo tags such as `{{ first_name|default:'there' }}` import as literal text. AlpacaRelay doesn't interpret them, so they stay intact and still resolve when Klaviyo sends.
## Troubleshooting
Access was revoked on Klaviyo's side, or the authorization expired. Click **Reconnect** and approve again.
That's the wrong connection path — the integration is OAuth-only. Don't paste a private key; contact support instead.
Expected. Exports are HTML templates, which Klaviyo opens in its code editor. Edit in AlpacaRelay and re-sync.
The picker filters by editor type — check the other views. Drag-and-drop templates that expose no usable HTML are listed but greyed out.
# Mailchimp
Source: https://alpacarelay-2b28e4cc.mintlify.app/integrations/mailchimp
Connect Mailchimp with OAuth to import your saved templates and push AlpacaRelay designs back as templates.
Connecting Mailchimp lets you import the templates already saved in your account, and push AlpacaRelay designs back out as saved templates you can pick when building a campaign.
New to integrations? The [overview](/integrations/overview) explains the import and export flows that are the same for every provider. This page covers what's specific to Mailchimp.
## What you need
* A Mailchimp account you can sign in to. Any paid or free plan works.
* Permission to authorize apps on that account.
There's no API key to create and nothing to paste. Mailchimp uses OAuth, so you approve access by signing in.
## Connect Mailchimp
Go to **Settings** → **Connected apps**, then click **Connect app**.
A Mailchimp sign-in window opens.
Sign in with the Mailchimp account you want to use, then approve the request.
Mailchimp's OAuth doesn't offer per-permission checkboxes, so you won't see a scope list — approving grants access to the account you signed in as.
Mailchimp appears in your connected apps with a **Connected** badge and your Mailchimp account name next to it.
If you manage several Mailchimp accounts, the account name on the badge is how you confirm you connected the right one. Sign out of Mailchimp in that browser first if you keep picking up the wrong account.
Mailchimp hosts each account in a specific data center. AlpacaRelay resolves yours automatically during the connection — there's no region to choose.
## Export a design to Mailchimp
Save the email, then open **Send to app** from the editor's name dropdown or the **⋯** menu on an email card, and click **Create template** on the Mailchimp row.
The design is pushed as a **saved template**, so it shows up with your other templates when you start a campaign in Mailchimp and choose to build from a saved template.
**Re-sync** updates that same template in place. The template ID doesn't change, so a campaign already built from it picks up the new design.
A Mailchimp campaign that has already been sent is a snapshot — re-syncing the template won't retroactively change it. Re-sync affects the template, and therefore anything you build from it afterwards.
## Import a template from Mailchimp
Click **Import** when creating an email, choose **Mailchimp** under **Integrations**, and pick a template.
Mailchimp organizes templates into views, and you can switch between them in the picker:
* **Your templates** — templates saved in your account, including any AlpacaRelay has exported
* **Mailchimp's base and gallery templates** — the built-in starting points
* **Folders** — any folders you've created for your own templates
Templates that Mailchimp doesn't expose editable HTML for are greyed out, with the reason on hover. Mailchimp shows a thumbnail for most templates, so the picker previews them.
Templates built with Mailchimp's drag-and-drop editor often can't be imported cleanly, because the editor stores a block structure rather than plain HTML. Classic and custom-coded templates import reliably.
Mailchimp merge tags such as `*|FNAME|*` come across as literal text. AlpacaRelay doesn't interpret them, so they stay intact and still work when Mailchimp sends the email.
## Troubleshooting
Access was removed on Mailchimp's side — usually because someone revoked the authorized app under the account's integrations, or the account was closed. Click **Reconnect** and sign in again.
Disconnect it, sign out of Mailchimp in your browser, then connect again. Any email-to-template links from the old account are pointing at templates the new account doesn't have — unlink them and create fresh templates.
Mailchimp's drag-and-drop templates don't always translate to standalone HTML. Try importing the template's classic or coded equivalent, or export the HTML from Mailchimp and use **Paste code** instead.
# Integrations overview
Source: https://alpacarelay-2b28e4cc.mintlify.app/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:
Pull a template that already lives in your ESP into AlpacaRelay, then edit it like any other email.
Push a finished AlpacaRelay email into your ESP as a template, and re-sync it whenever you change the design.
### Supported providers
Connects with OAuth. Exports a saved template.
Connects with OAuth. Exports an HTML template.
Connects with an API key. Exports a dynamic template.
Connects with a server token. Exports a standard template.
| 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 |
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.
### 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.
Click your workspace name, then **Settings** → **Connected apps**.
Click **Connect app** and choose your provider.
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.
The provider appears in your connected apps list with a **Connected** badge and the account name it resolved.
**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.
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
Export pushes the last **saved** version of a design, not unsaved edits in the editor. Save before you push.
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.
Each connected provider gets a row. Click **Create template** to push the design.
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.
#### 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.
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.
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.
**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.
Deleting an AlpacaRelay email removes its links. Nothing is deleted in your ESP.
The next **Re-sync** notices it's gone, drops the stale link, and creates a fresh template instead of failing permanently.
#### 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
From the emails list or the new-email screen, click **Import**.
Your connected providers are listed under **Integrations** in the modal's sidebar, alongside **Upload file** and **Paste code**.
Browse the templates in that account and select one. Some providers group templates into views — use the view switcher to move between them.
The template's HTML is converted into an editable AlpacaRelay email. From there it behaves like anything else you've designed.
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.
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
The email has never been saved with content. Add something to the design, save, then push.
It hasn't been connected for this workspace yet. An owner needs to add it under **Settings** → **Connected apps**.
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.
The linked template was deleted in your ESP, so AlpacaRelay made a new one. Repoint any campaign that referenced the old template.
## 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.
Sync customers, appointments, and purchase activity — then import your customers as contacts.
Square never receives your designs and never sends your email. It's a source of people and activity to send *to*.
# Postmark
Source: https://alpacarelay-2b28e4cc.mintlify.app/integrations/postmark
Connect Postmark with a server API token to import standard templates and push AlpacaRelay designs back as templates.
Connecting Postmark lets you import the templates on a Postmark server and push AlpacaRelay designs back out as templates you can send with.
New to integrations? The [overview](/integrations/overview) explains the import and export flows that are the same for every provider. This page covers what's specific to Postmark.
## What you need
* A Postmark account. The free Developer plan is enough — templates aren't metered, and AlpacaRelay never sends through your account.
* A **Server API token** from the specific server whose templates you want to work with.
Postmark has no OAuth. It authenticates with tokens only, so you create a token and paste it in once.
Use a **Server** token, not an **Account** token. They look alike but do different jobs: account tokens manage servers and billing, while every call this integration makes is server-level. An account token fails to connect.
## Get the server token
In Postmark, go to **Servers**. Templates belong to one server, so the token you choose decides which templates AlpacaRelay sees.
Creating a new server for this? Tick **Sandbox**. A sandbox server accepts and reports messages normally but routes them nowhere, which makes it safe for the test-send button inside Postmark's own template editor.
Select your server, then open **API Tokens**.
Copy it. Unlike some providers, Postmark lets you return to this page later.
## Connect Postmark
Go to **Settings** → **Connected apps**, then click **Connect app**.
A secure form opens, asking for your token.
Submit it. AlpacaRelay verifies the token immediately by reading the server.
Postmark appears in your connected apps with a **Connected** badge and the name of the server you connected.
The server name on the badge is how you confirm you connected the right one. If you keep templates on separate servers for staging and production, that name is the only thing distinguishing them.
Because a connection is scoped to one server, and a workspace holds one Postmark connection, you can reach one server's templates at a time. Disconnect and reconnect with a different token to switch servers.
## Export a design to Postmark
Save the email, then open **Send to app** from the editor's name dropdown or the **⋯** menu on an email card, and click **Create template** on the Postmark row.
The export creates a **standard template** on the connected server, which you'll find under **Templates**. **Re-sync** updates that same template in place, so code sending by template alias or ID picks up the new design.
**Known limitation.** Postmark doesn't store a template body as plain HTML — it parses the body as a [Mustachio template](https://postmarkapp.com/support/article/1077-template-syntax) and validates the syntax when the template is saved. A body it can't parse is rejected, and the export fails.
This most often bites on a **round trip**: Postmark's own starter templates are full of `{{ }}` tags by design, so a template imported from Postmark carries them back out again, and a tag that gets reshaped anywhere along the way stops parsing.
If an export to Postmark fails while your other providers succeed, this is the likely cause. Check the design for `{{ }}` tags, and check Postmark's activity log for a `422` with error code `1122`. We're working on handling this in the Postmark export itself. Exporting the same design to Mailchimp, Klaviyo, or SendGrid is unaffected — they store HTML verbatim.
Postmark limits each server to **100 templates**. Exports fail once you hit it, so prune templates you no longer send.
## Import a template from Postmark
Click **Import** when creating an email, choose **Postmark** under **Integrations**, and pick a template.
The picker lists the **standard** templates on the connected server. Postmark's API exposes no thumbnails, so rows show names without previews.
**Layouts** are listed separately from standard templates, not mixed in. A layout is a wrapper that other templates slot into rather than a complete email, so importing one gives you the frame without content.
Postmark starter templates contain Mustachio placeholders such as `{{name}}`. They import as literal text — AlpacaRelay doesn't interpret them. That's expected, though see the export warning above before pushing such a design back.
## Troubleshooting
Almost always an **Account** token instead of a **Server** token. Go to **Servers** → your server → **API Tokens** and copy from there, not from **Account** → **API Tokens**.
The connected server has no standard templates yet. Add one in Postmark — a starter template saved unedited is enough — or check whether your templates live on a different server.
Postmark's template parser is rejecting the body. See the known limitation above.
You may have hit the 100-templates-per-server limit. Delete unused templates in Postmark and retry.
Disconnect Postmark, then connect again with that server's token. Links to the old server's templates won't resolve — unlink them and create fresh templates.
# SendGrid
Source: https://alpacarelay-2b28e4cc.mintlify.app/integrations/sendgrid
Connect SendGrid with an API key to import dynamic templates and push AlpacaRelay designs back as dynamic transactional templates.
Connecting SendGrid lets you import your dynamic transactional templates and push AlpacaRelay designs back out as dynamic templates your application can send with.
New to integrations? The [overview](/integrations/overview) explains the import and export flows that are the same for every provider. This page covers what's specific to SendGrid.
## What you need
* A Twilio SendGrid account.
* A SendGrid API key with access to templates and account information.
SendGrid doesn't offer OAuth for this, so you create an API key and paste it in once.
## Create the API key
In SendGrid, go to **Settings** → **API Keys** and click **Create API Key**.
`AlpacaRelay` works — the name is only for your own audit trail later.
Then grant only these permissions:
| Permission | Access | Why |
| --------------- | ----------- | ------------------------------------------------------------- |
| Template Engine | Full Access | Read, create, and update your dynamic templates |
| User Account | Read Access | Confirms the connection and shows which account you connected |
Leave everything else off. **Mail Send** is not needed — AlpacaRelay never sends through your SendGrid account.
SendGrid shows the key exactly once. Copy it before leaving the page.
A Full Access key works too, but it can send mail and change billing on your account. Prefer the restricted key above.
## Connect SendGrid
Go to **Settings** → **Connected apps**, then click **Connect app**.
A secure form opens, asking for your API key.
Paste the key you just created and submit. AlpacaRelay verifies it immediately by reading your account information.
SendGrid appears in your connected apps with a **Connected** badge and your SendGrid username or account email.
Your API key is stored encrypted and is never shown back to you or exposed to the browser. To rotate it, create a new key in SendGrid, then **Reconnect** here and paste the new one.
## Export a design to SendGrid
Save the email, then open **Send to app** from the editor's name dropdown or the **⋯** menu on an email card, and click **Create template** on the SendGrid row.
The export creates a **dynamic transactional template** and an **active version** inside it holding your design. You'll find it under **Email API** → **Dynamic Templates** in SendGrid.
Because the version is marked active, your application can send it by template ID straight away — no extra step in SendGrid.
**Re-sync** updates the active version of that same template. The template ID stays the same, so code already sending that ID picks up the new design on its next send.
Grab the template ID from SendGrid once and your application never needs to change it again, however many times you re-sync the design.
Plain text is regenerated from the design on each sync, so the text alternative stays in step with the HTML.
## Import a template from SendGrid
Click **Import** when creating an email, choose **SendGrid** under **Integrations**, and pick a template.
The picker lists your **dynamic** templates and reads the HTML from each one's active version. SendGrid provides thumbnails for most templates, so rows show a preview.
SendGrid's older **legacy** transactional templates aren't listed. Only dynamic templates appear. If a template you expect is missing, it's likely a legacy one — recreate it as dynamic in SendGrid, or export its HTML and use **Paste code** instead.
A dynamic template with no active version has no HTML to read, so it appears greyed out.
Handlebars syntax such as `{{first_name}}` imports as literal text. AlpacaRelay doesn't interpret it, so it survives the round trip and still resolves when SendGrid sends.
## Troubleshooting
The key is missing **User Account** read access, was truncated when copied, or has already been deleted in SendGrid. Create a fresh restricted key and try again.
The API key was deleted or rotated in SendGrid. Create a new one, click **Reconnect**, and paste it.
The key can probably read your account but not write templates. Check that **Template Engine** is set to Full Access, not Read Access.
Only dynamic templates with an active version are listed. Legacy templates never appear.
# Square
Source: https://alpacarelay-2b28e4cc.mintlify.app/integrations/square
Connect Square to sync your customers, appointments, and purchase activity into AlpacaRelay.
Square works in the opposite direction to an ESP integration. Rather than pushing a design out, AlpacaRelay pulls your business data **in** — customers, orders, payments, refunds, and appointments — so you can see your business at a glance and email the people in it.
Square doesn't send your emails and doesn't receive your designs. If you're looking to push a finished design into a sending platform, see the [integrations overview](/integrations/overview).
## What you get
Revenue, orders, refunds, appointments, and customer counts, read from your synced Square data.
Import your Square customers as AlpacaRelay contacts, then segment and send to them.
AlpacaRelay keeps its own copy of your Square data rather than calling Square each time you open a page. That's what makes the dashboard fast and keeps it working when Square is briefly unavailable.
| Synced from Square | What it's used for |
| ------------------ | ------------------------------------------------ |
| Customers | Contact import, segmentation, personalization |
| Orders | Purchase history, top products and services |
| Payments | Gross and net revenue, processing fees |
| Refunds | Net revenue, refund reporting |
| Appointments | Upcoming bookings — requires Square Appointments |
## What you need
* A Square account with a seller you can authorize.
* **Square Appointments activated**, if you want appointment data. It's a separate product in your Square dashboard; without it, everything else still syncs.
## Connect Square
Go to **Settings** → **Connected apps**, then click **Connect app** and choose **Square**.
Square's authorization page opens. Sign in as the seller whose data you want to sync.
Approve all of them. AlpacaRelay requests read-only access — it never modifies anything in your Square account, and never charges or refunds.
Declining any permission leaves the connection in a state that can't sync. Square grants permissions once, at the moment you authorize, so a partial approval can only be fixed by reconnecting and accepting everything.
Connecting automatically starts a **12-month backfill** of your history. Larger accounts take longer — the connection shows **Syncing your Square data…** until it finishes.
## Connection states
Square reports more states than a simple connected/disconnected, because the fixes differ:
| State | What it means | What to do |
| ----------------------------------------- | ------------------------------------ | ---------------------------------------- |
| **Connected** | Syncing normally | Nothing |
| **Syncing your Square data…** | First sync, or a sync in progress | Wait — the dashboard fills in as it goes |
| **Authorization is no longer valid** | Access was revoked or expired | **Reconnect** |
| **Missing permissions** | You connected but declined something | **Reconnect** and accept all permissions |
| **The last sync failed** | A transient failure | Nothing — it retries automatically |
| **Automatic synchronization has stopped** | Someone disconnected it | **Connect** again |
If we add a new Square permission in future, you'll be asked to reconnect. Square can't add a permission to an authorization that already exists, so this is unavoidable — we batch permission changes to keep it rare.
## View your business data
The **Business** section shows what's been synced.
Business isn't in the sidebar yet. Reach it by adding `?section=business` to your workspace URL — for example `app.alpacarelay.com/app/your-workspace?section=business`.
Six tiles summarize the selected date range: **Gross revenue**, **Net revenue**, **Refunds**, **Orders**, **Appointments**, and **Customers**. Below them, tabs list the underlying records: **Payments**, **Orders**, **Appointments**, **Refunds**, and **Customers**.
A few things worth knowing before you read a number as gospel:
An open order, or a payment that's authorized but not captured, isn't revenue yet and isn't counted. This is usually why a tile reads lower than your Square dashboard for the same day.
Square doesn't report the fee until then. Rather than guess at it, AlpacaRelay tells you fees are still pending — so **Net revenue** on very recent payments is incomplete rather than wrong.
Payments, Orders, and Refunds are filtered by the selected range, which defaults to the last 30 days. Customers isn't filtered — you see everyone synced.
Past appointments aren't browsable yet. A business with no future bookings sees an empty tab even when it has history.
Every location is synced and its records carry the location they belong to. Revenue figures cover all of them, not just your main location.
## Keep your data fresh
Click **Sync now** in the Business section to pull recent changes. That catches anything created or updated in roughly the **last four days** — deliberately wider than it sounds, because Square can take up to 72 hours to receive orders taken on a point-of-sale terminal that was offline.
**There's no scheduled sync yet.** After the initial backfill, your data stays as it is until someone clicks **Sync now**. If a dashboard number looks stale, that's the first thing to check.
The 12-month backfill runs only when you first connect. To re-run a full history sync, disconnect and reconnect.
## Import Square customers as contacts
This is what turns Square data into email you can actually send.
Open **Audience** → **Contacts** in the sidebar.
Choose Square as the import source. Your customers are read live from Square, so you don't need to sync first.
You'll see how many customers were scanned, how many became contacts, and how many were skipped.
Imports bring across **email address, first name, and last name**. Up to 10,000 customers are imported at a time.
Customers are skipped when they have **no email address**, or an address that isn't valid — Square accepts customer records without one, but there's nothing to send to. Skipped records are counted so the numbers reconcile.
**Check consent before you send.** Square only records whether someone has *unsubscribed* — it has no positive opt-in signal — and imported contacts arrive with consent marked unknown rather than opted-in. Unknown is not consent. If you have people in Square who unsubscribed there, review your contacts before sending a marketing campaign to a freshly imported list.
Once imported, Square customers behave like any other contact: build a segment from them, and send.
## Appointments and Square Appointments
Appointment data needs **Square Appointments** switched on in your Square dashboard. It's a separate Square product, not a permission.
If it isn't active, Square refuses appointment requests and AlpacaRelay records a warning against that one data type — the sync still completes and everything else still syncs. You'll see a note above the Appointments tab explaining it.
This case looks identical to an expired authorization from Square's side. If you see a warning about appointments specifically while payments and customers sync fine, the fix is in your Square dashboard, not in reconnecting.
## Sandbox and production are separate
If you've been testing with a Square sandbox seller, none of that data exists in your real Square account. They're entirely separate systems with separate merchants and separate records — connecting production gives you a fresh backfill of your real history.
## Privacy
Synced customer records include personal data: email addresses, phone numbers, postal addresses, birthdays, and any notes on the customer in Square. Treat the Business section accordingly, and remember that importing customers as contacts copies their email addresses into AlpacaRelay.
AlpacaRelay never stores your Square access tokens. Authorization is held by our integration provider, and access is read-only throughout.
## Troubleshooting
The first sync walks 12 months of history and takes time on a busy account. The connection shows a syncing state while it runs.
Check the date range first — Payments, Orders, and Refunds default to the last 30 days, and a quiet month looks like a broken integration. Then check the Customers tab, which isn't date-filtered: if customers are there, syncing works and the range is the issue.
Tiles count completed activity only, and processing fees on unsettled payments are still pending. Both make recent figures conservative rather than wrong.
Either Square Appointments isn't active, or you have no upcoming appointments — the tab is forward-looking and doesn't show past bookings.
A missing-permission state can't be cleared by reconnecting alone. Reconnect and make sure you accept every requested permission on Square's page.
Expected — there's no scheduled sync yet. Click **Sync now**.