Send emails programmatically via the SDK, CLI, or API.The from address determines your sending domain — it must be a verified domain. The optional providerType field selects which email service provider delivers the message. It defaults to migma (built-in sending).
Migma (default)
Amazon SES
Resend
SendGrid
Mailgun
No providerType needed — Migma sends by default. Use a verified sending domain (managed or custom).
Migma automatically infers the email type from how you send:
Send type
Default behavior
Example
Single recipient (recipientType: 'email')
Transactional
Order confirmations, password resets
Batch (recipientType: 'audience', 'tag')
Marketing
Newsletters, promotions
Transactional emails bypass subscription status, skip topic filtering, and omit List-Unsubscribe headers. Bounced addresses are always excluded.This means single sends just work — no extra flags needed:
Copy
Ask AI
// Automatically treated as transactional — no flag neededawait migma.sending.send({ recipientType: 'email', recipientEmail: 'customer@example.com', from: 'noreply@yourcompany.migma.email', fromName: 'Your Company', subject: 'Your order has shipped', template: html, projectId: 'proj_123'});
For edge cases, use the transactional flag to override the default:
Only use transactional: true on batch sends for emails the recipient expects regardless of subscription status (renewal reminders, security alerts). Using it for promotional content violates CAN-SPAM and GDPR.