Product
Embed forms
Signup forms capture emails on your storefront or landing pages and send them into MailPirate.
Create a form
- Open Signup forms (Forms).
- Click New form - opens the form builder.
- 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
- 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:
- Open the form in MailPirate and copy the WordPress shortcode, e.g.
[mailpirate_form id="01H..."]. - Paste it into any page, post, widget, or page builder that accepts shortcodes.
- 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.
Publish with HTML (any site)
For Shopify, custom themes, or landing pages without the plugin:
- Place a mount where the form should appear:
<div data-mp-form="01H..."></div>
- Load the script once per page (theme footer is fine), even with multiple mounts:
<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
- Visitor enters email (and optional name/phone fields if present).
- MailPirate upserts a profile for that store.
- The person is added to the form’s list (or the default newsletter list).
- If DOI is required, status stays pending until they confirm; otherwise they can become subscribed immediately per your settings.
- 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:
{
"email": "[email protected]",
"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.
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
- Lists
- Abandoned cart (WooCommerce plugin)
- API overview