Skip to main content
Use Migma from Slack through OpenClaw or your own Slack app. The Slack layer receives messages and posts replies. Migma handles brand access, email generation, preview screenshots, HTML, validation, and approved send or export actions. Use this guide when building a Slack app around Migma, or when defining the expected Slack behavior for an OpenClaw setup. Example Slack prompts:
  • migma create 3 emails for Stripe and show me images
  • migma create 3 emails for this brand and give me the HTML files
  • migma import https://stripe.com, create 3 onboarding emails, and return previews
  • migma make these emails shorter and send me updated HTML
Slack is a chat surface for Migma, not a sending provider. Slack handles workspace install and message delivery. Migma handles brand access, email generation, previews, HTML, validation, and sending or export only after approved access.
1

Authenticate the Slack user

Ask the user to connect Migma from Slack. Use Agent registration so the Slack app or OpenClaw agent receives its own scoped Migma key after the user approves a short code.
2

Resolve the brand

If the prompt names a brand, list the user’s Migma brands and filter by name. If there is one match, set that brand’s projectId for the request. If there are multiple matches, ask the user to choose. If no brand exists, ask for a website URL and import the brand before creating email.
3

Prepare the emails

Send the user’s prompt to Migma with the selected projectId. Pass count: 3 when the user asks for three emails.
4

Return reviewable output

Post each subject and preview image in the Slack thread. Attach .html files when the user asks for HTML.
5

Wait for approval

Keep send, schedule, export, and audience actions behind an explicit Slack confirmation.

Auth model

Use Agent registration for Slack apps that act for individual Migma users. Slack workspace install only lets the app receive messages and post replies. Migma access starts when the app begins the agent-auth flow, shows the user a Migma approval link, then stores the issued Migma key server-side for that Slack user. Recommended scopes:
Slack capabilityMigma scopes
List brands and fetch generated outputDefault read access or email:read
Import a missing brand, prepare emails, or edit emailsemail:send email:read
Manage brand assets, logos, or knowledge base entriesproject:write
Return preview screenshotsemail:preview
Run preflight checksemail:validate
Create campaign drafts or send testscampaign:write email:send
Do not ask users to paste a Migma API key into Slack. Use agent registration for user-approved access, or use a manually created API key only for an admin-owned internal bot where the workspace owner controls the key.
For protocol details, see Agent Auth Reference. For standard server-side API keys, see Authentication.

Brand resolution

When a prompt says for Stripe, the app should choose the brand in this order:
  1. Use a saved default brand for the Slack channel or user.
  2. List Migma brands, filter by name, and ask the user to pick when there are multiple matches.
  3. If no brand exists, ask for a website URL before importing a new brand.
  4. Store the selected projectId only as a Slack preference. Pass it on Migma requests instead of exposing it in Slack copy.
Do not create a new brand from a name alone. Ask for a website URL or explicit confirmation before import.

Output rules

User asks forSlack should return
show me imagesSubject lines plus preview images for each generated email.
give me the HTML filesOne .html file per generated email, named from the subject or slot number.
create 3 emailsThree generated emails from one Migma generation, with one Slack thread containing all outputs.
send thisConfirmation prompt showing recipient, sender, subject, and brand before Migma sends.
Migma generation results include per-email IDs, HTML, screenshot URLs, subjects, and series order. Use those per-email records when attaching files, showing images, editing one email, or sending one slot from a series.

Slack command behavior

Keep Slack responses short and review-first:
Migma prepared 3 emails for Stripe.

1. Welcome trial users
2. Show Stripe Billing value
3. Invite upgrade review

Attached: previews and HTML files.
Next: reply "edit email 2" or "send test email 1 to me".
For longer work, post progress in the thread:
  • Connecting Migma
  • Finding brand
  • Importing brand
  • Preparing 3 emails
  • Rendering previews
  • Attaching HTML

Safety

  • Store Migma keys server-side, encrypted, and mapped to the Slack user or workspace that approved access.
  • Keep Slack tokens separate from Migma tokens.
  • Request only the scopes needed for the Slack action.
  • Do not post API keys, raw bearer tokens, or private customer data into Slack.
  • Require confirmation before sending, scheduling, exporting to another platform, or changing audiences.
  • Revoke Migma access from Settings → Developers → API Keys when a Slack user disconnects.

Agent Registration

Let the Slack app request scoped Migma access with a user approval code.

Agent Auth Reference

Implement the auth.md claim flow for a Slack app.
https://mintcdn.com/migmaai/kT6TJgF40rDP8_qB/images/logos/npm.svg?fit=max&auto=format&n=kT6TJgF40rDP8_qB&q=85&s=1839361b0494d7d3199cdaa3575846ac

SDK

Generate series, fetch HTML, and read screenshot URLs from server-side code.

OpenClaw

Use Migma in Slack through the OpenClaw agent.