DocsOMailerAutomation Sequences
Marketing Suite

Automation Sequences

OMailerorravo.com/docs/omailer/automation

Automation Sequences

OM_Automation provides trigger-based drip sequences. Each automation has one trigger and an ordered list of steps.

Trigger Types

TriggerDescription
subscribeFires when a subscriber is added
tag_addedFires when a specific tag is assigned
form_submitFires when an OForms form is submitted
wp_hookFires on any custom WordPress action
wc_purchaseWooCommerce: order payment complete
wc_abandoned_cartWooCommerce: cart abandoned for 60+ min
wc_refundWooCommerce: order refunded
wc_review_leftWooCommerce: product review posted
rss_updatedRSS feed has new items

Step Types

StepConfig
send_email{ subject, body } — sends email to subscriber
delay`{ unit: 'minutes''hours''days', value: int }`
add_tag{ tag_id: int }
remove_tag{ tag_id: int }
update_field{ field_key: string, value: string }
condition{ type: condition_type, value: any, yes_steps: [], no_steps: [] }

PHP API

php// Create an automation
$auto_id = OM_Automation::create(
    'Welcome Series',
    'subscribe',   // trigger_type
    ''             // trigger_value (for tag_added: tag slug; for wp_hook: hook name)
);

// Define the steps
OM_Automation::save_steps( $auto_id, [
    [ 'step_type' => 'send_email', 'step_config' => [ 'subject' => 'Welcome!', 'body' => 'Hi {{first_name}}...' ], 'sort_order' => 1 ],
    [ 'step_type' => 'delay',      'step_config' => [ 'unit' => 'days', 'value' => 3 ], 'sort_order' => 2 ],
    [ 'step_type' => 'add_tag',    'step_config' => [ 'tag_id' => 7 ], 'sort_order' => 3 ],
    [ 'step_type' => 'send_email', 'step_config' => [ 'subject' => 'Day 3 follow-up', 'body' => '...' ], 'sort_order' => 4 ],
]);

// Manually trigger an automation for a subscriber
OM_Automation::trigger( 'subscribe', $subscriber_id );

// Enable / disable
OM_Automation::update( $auto_id, [ 'status' => 'active' ] );   // active|paused

Cron

om_process_automations runs every 5 minutes. It queries om_automation_runs for rows where next_run_at <= NOW() and status = 'running', then advances each run to its next step.

Automation Sequences — OMailer Docs — Orravo