---
title: Embed forms
description: Embed forms - MailPirate Docs
---

# Embed forms

Signup forms capture emails on your storefront or landing pages and send them into MailPirate.

## Create a form

1. Open **Signup forms** (Forms).
2. Click **New form** - opens the form builder.
3. Edit with a live preview:
    - **Basics** - internal name, headline, supporting text, button, success message, list, live/off, double opt-in
    - **Layout** - stack, inline, split, or compact
    - **Fields** - toggle email (always on), first name, last name, phone; reorder; labels and placeholders
    - **Look** - colors, font, alignment, padding, gap, corner radius, max width, optional legal line
4. **Save**, then publish (see below). Live forms show as **Live** on the list.

Typical defaults: headline “Join the list”, button “Subscribe”, success “Thanks - check your email to confirm.”

## Publish on WordPress (recommended)

If you use **MailPirate for WooCommerce**:

1. Open the form in MailPirate and copy the **WordPress shortcode**, e.g. `[mailpirate_form id="01H..."]`.
2. Paste it into any page, post, widget, or page builder that accepts shortcodes.
3. Or in the block editor, add the **MailPirate Form** block and pick a live form.

The plugin loads MailPirate’s form script **once per page**, even if you place several forms. Design changes apply after you save in MailPirate - you do not need to republish the WordPress page.

Plugin setup (API token + store slug) is the same as for [abandoned cart](/docs/abandoned-cart).

## Publish with HTML (any site)

For Shopify, custom themes, or landing pages without the plugin:

1. Place a **mount** where the form should appear:

```html
<div data-mp-form="01H..."></div>
```

2. Load the script **once** per page (theme footer is fine), even with multiple mounts:

```html
<script src="https://app.mailpirate.com/js/mp-form.js" async></script>
```

You can repeat the mount div for different form IDs. Do **not** paste a full script tag for every form.

The embed fetches your saved design and posts to the public subscribe endpoint for that form’s public ID. Visitors never need a Marketing API token. Re-save in the builder to update every placement without changing the mount markup.

## What happens on submit

1. Visitor enters email (and optional name/phone fields if present).
2. MailPirate upserts a profile for that store.
3. The person is added to the form’s list (or the default newsletter list).
4. If DOI is required, status stays **pending** until they confirm; otherwise they can become **subscribed** immediately per your settings.
5. The success message from the form is shown / returned.

All visitor form traffic (script, config, subscribe) goes to MailPirate. The merchant page only hosts the mount point (or the plugin shortcode/block).

## Building your own UI

If you do not want the embed script, call the JSON endpoint yourself:

`POST /api/v1/marketing/forms/{form_public_id}/subscribe`

Body:

```json
{
  "email": "buyer@example.com",
  "first_name": "Ada",
  "last_name": "Lovelace"
}
```

No Marketing API token. Rate limit: 30 requests per minute. Disabled or unknown forms return `404`.

Full reference: [Embed form endpoint](/docs/api/embed-forms).

## Preferences after signup

Recipients can manage topics later from the preference link in emails, or unsubscribe from all. Keep `{{ preferences_url }}` and `{{ unsubscribe_url }}` in every marketing template.

## Related

- [Profiles & consent](/docs/profiles)
- [Lists](/docs/lists)
- [Abandoned cart](/docs/abandoned-cart) (WooCommerce plugin)
- [API overview](/docs/api/overview)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://mailpirate.com/#organization","name":"MailPirate","legalName":"Jure Rožman s.p.","url":"https://mailpirate.com/","logo":{"@type":"ImageObject","@id":"https://mailpirate.com/#logo","url":"https://mailpirate.com/img/logo/mailpirate-logo.svg","contentUrl":"https://mailpirate.com/img/logo/mailpirate-logo.svg"},"image":{"@id":"https://mailpirate.com/#logo"},"description":"MailPirate is email marketing built for ecommerce stores: campaigns, automated journeys, living audiences, store sync, and deliverability control without managing mail servers yourself.","slogan":"Email that sells more for your store.","foundingDate":"2019-01-29","founder":{"@id":"https://mailpirate.com/#person-jure-rozman"},"address":{"@type":"PostalAddress","streetAddress":"Šinkov Turn 24A","addressLocality":"Vodice","postalCode":"1217","addressCountry":"SI"},"email":"info@mailpirate.com","telephone":"+38640504630","vatID":"SI72369213","identifier":[{"@type":"PropertyValue","propertyID":"AJPES registration number","value":"6881475000"}],"contactPoint":{"@type":"ContactPoint","contactType":"customer support","email":"info@mailpirate.com","telephone":"+38640504630","availableLanguage":["English"]},"knowsAbout":[{"@type":"Thing","name":"Email marketing"},{"@type":"Thing","name":"Ecommerce automation"},{"@type":"Thing","name":"Email deliverability"}],"areaServed":["SI","EU","GB","US"],"sameAs":["https://www.linkedin.com/company/mailpirate"]},{"@type":"Person","@id":"https://mailpirate.com/#person-jure-rozman","name":"Jure Rožman","jobTitle":"Founder","worksFor":{"@id":"https://mailpirate.com/#organization"},"description":"Founder of MailPirate. Builds ecommerce email tooling focused on fair billing, automation, and deliverability.","url":"https://mailpirate.com/about-us","sameAs":["https://www.linkedin.com/in/jurerozman/"]},{"@type":"WebSite","@id":"https://mailpirate.com/#website","url":"https://mailpirate.com/","name":"MailPirate","inLanguage":"en","publisher":{"@id":"https://mailpirate.com/#organization"},"about":{"@id":"https://mailpirate.com/#software"}},{"@type":"SoftwareApplication","@id":"https://mailpirate.com/#software","name":"MailPirate","applicationCategory":"BusinessApplication","applicationSubCategory":"Email marketing","operatingSystem":"Web","url":"https://mailpirate.com/","description":"Ecommerce email platform for Shopify and WooCommerce stores: campaigns, flows, segments, intelligence, and dedicated sending with deliverability controls.","publisher":{"@id":"https://mailpirate.com/#organization"},"featureList":["Campaigns and reporting","Automated flows (welcome, cart recovery, win-back)","Segments and lists","Store connectors (Shopify, WooCommerce)","Intelligence (RFM, affinity, send-time, replenishment)","Deliverability scorecard and dedicated sending","Marketing API and embed forms"]}]}
```
