DocsOMailerTags & Segmentation
Marketing Suite

Tags & Segmentation

OMailerorravo.com/docs/omailer/tags-segmentation

Tags & Segmentation

Tags

Tags are freeform labels attached to subscribers. Stored in om_tags and om_subscriber_tags.

php// Tag management
$tag_id = OM_Tags::create( 'vip-customer' );      // returns int
OM_Tags::assign( $subscriber_id, $tag_id );
OM_Tags::remove( $subscriber_id, $tag_id );
$tags = OM_Tags::get_for_subscriber( $subscriber_id );  // returns array

// Check if subscriber has tag
$has = OM_Tags::has( $subscriber_id, 'vip-customer' );  // bool

// Get all subscribers with a specific tag
$subs = OM_Tags::get_subscribers( $tag_id );

Assigning a tag fires:

phpdo_action( 'om_tag_assigned', $subscriber_id, $tag_id );

Segments

Segments are saved dynamic filters. A segment query is re-evaluated at send time — subscribers enter or leave based on current data. Stored as JSON conditions in om_segments.

Condition types:

ConditionOperatorValue
status_is=subscribed / unsubscribed / bounced / pending
tag_ishastag slug
tag_notdoesn't havetag slug
list_isonlist ID
list_notnot onlist ID
field_equals=custom field key + value
field_containscontainscustom field key + string
field_gt>custom field key + number
field_lt<custom field key + number
opened_campaignopenedcampaign ID
clicked_campaignclickedcampaign ID
not_openeddid not opencampaign ID
subscribed_afterafterISO date
subscribed_beforebeforeISO date
source_is=source string
engagement_gte>=0–100
engagement_lte<=0–100

Conditions are grouped: conditions within a group are ANDed; groups are ORed.

php// Create a segment
$seg_id = OM_Segments::create(
    'High-Value Engaged',
    [
        // Group 1: tag is vip AND engagement >= 60
        [
            [ 'type' => 'tag_is',        'value' => 'vip' ],
            [ 'type' => 'engagement_gte','value' => 60 ],
        ],
    ],
    'VIP subscribers with high engagement score'
);

// Resolve subscribers matching a segment
$subscriber_ids = OM_Segments::resolve( $seg_id );  // returns int[]
Tags & Segmentation — OMailer Docs — Orravo