DocsOMailerCampaigns
Marketing Suite

Campaigns

OMailerorravo.com/docs/omailer/campaigns

Campaigns

Campaigns are one-time email blasts sent to a list or segment.

Campaign Statuses

StatusMeaning
draftNot yet sent or scheduled
scheduledWill send at scheduled_at
sendingActive batch send in progress
sentCompleted
pausedPaused mid-send (manual or rate-limit)

Send Modes

ModeBehaviour
immediateBatches sent immediately on save-and-send
scheduledSends at the specified scheduled_at datetime
smartSends to each subscriber at their optimal hour (requires open history)

PHP API

php// Create a campaign
$id = OM_Campaign::create([
    'subject'      => 'Your July Newsletter',
    'preview_text' => 'Inside: summer updates and new features',
    'from_name'    => 'Jane at Acme',
    'from_email'   => 'jane@acme.com',
    'html_content' => '<h1>Hello {{first_name}}</h1>...',
    'list_id'      => 3,       // null = all subscribers
    'send_mode'    => 'immediate',
]);

// Schedule a campaign
OM_Campaign::schedule( $id, '2026-08-01 09:00:00' );

// Pause a running campaign
OM_Campaign::pause( $id );

// Resume a paused campaign
OM_Campaign::resume( $id );

// Get stats for a campaign
$stats = OM_Campaign::get_stats( $id );
// Returns: open_rate, click_rate, bounce_rate, unsubscribe_rate, total_sent

Hooks

phpadd_action( 'om_campaign_before_send', function( int $campaign_id, array $subscriber_ids ) {} );
add_action( 'om_campaign_sent',        function( int $campaign_id ) {} );
add_action( 'om_campaign_paused',      function( int $campaign_id ) {} );

// Filter HTML just before each individual email is sent
add_filter( 'om_personalise_html', function( string $html, int $subscriber_id, int $campaign_id ): string {
    return $html;
}, 10, 3 );
Campaigns — OMailer Docs — Orravo