Create Email Trigger
meisa_create_triggerCreate a new email trigger in Meisa that maps a trigger_key to an existing email template. Use this when the user wants to wire up a transactional email like a verification code, password reset, welcome email, or refund confirmation. After creation, external products call meisa_send_email (or the /email/trigger/ API) with this trigger_key to send the email. Requires a unique trigger_key, a name, and a template_id. The template must already exist (use meisa_list_templates to find its UUID).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable name for the trigger (shown in the dashboard). | |
| is_active | No | Whether the trigger is active (can accept send requests). Default true. | |
| sender_id | No | UUID of a SenderIdentity to use. Defaults to the product's default sender. | |
| conditions | No | Send conditions evaluated against the contact at send time. If they do not pass, the send is skipped (not an error). Empty or omitted means always send. Example: [{"field": "tag", "fieldName": "vip", "operator": "exists"}]. | |
| delay_unit | No | Unit for delay_value. Default 'minutes'. | |
| delay_value | No | Send delay amount. 0 (default) sends immediately. A positive value schedules the send; the conditions are re-checked when the delay elapses, so a contact who stops matching is skipped. | |
| description | No | Internal description of what this trigger does. | |
| template_id | Yes | UUID of the existing email template to link. Use meisa_list_templates to find it. | |
| trigger_key | Yes | Unique key used in API calls (e.g. 'verification_code', 'welcome', 'refund_confirmed'). Will be slugified to lowercase_with_underscores. | |
| email_category | No | Subscription category, so recipients can unsubscribe from this kind of email and keep the rest: 'onboarding' (tips and onboarding), 'product_updates', 'promotions' (offers and discounts), 'newsletter'. Empty string = automatic: the template's category decides (promotional -> promotions, announcement -> product_updates, newsletter -> newsletter), otherwise sequences and triggers use 'onboarding' and broadcasts use 'product_updates'. Ignored on triggers with override_unsubscribe (those are transactional and always send). | |
| condition_logic | No | Whether ALL conditions must pass ('all', the default) or ANY one ('any'). | |
| skip_rate_limit | No | Skip the per-contact 24h rate-limit guardrail. Default false. | |
| subject_override | No | Override the template's subject line. Supports {{variable}} personalization. | |
| expected_variables | No | List of variable names this trigger expects, e.g. ["pin", "reset_link"]. Used for dashboard documentation; not enforced at send time. | |
| override_unsubscribe | No | Send even to unsubscribed contacts. Use only for truly transactional emails (verification codes, password resets, refunds). Default false. | |
| skip_duplicate_check | No | Skip the duplicate-template guardrail. Default false. |