Email Segmentation With And/Or Rules
AND/OR rules turn contact data into a usable email audience. This guide explains how Boolean logic, nested groups, exclusions, timing and suppression rules work together, with examples that help prevent accidental over-mailing.
Email segmentation is often presented as a simple choice between two filters: AND and OR. In practice, those small words determine who receives a message, who is excluded, how often someone is contacted and whether a campaign reaches a genuinely relevant audience.
Used well, segmentation logic lets a retailer distinguish between recent customers and dormant browsers, or lets a SaaS business send a product update only to active users of the affected feature. Used carelessly, an OR rule can turn a narrow campaign into a send to most of the database.
The principles are the same in most email platforms, although the labels differ. Some use all and any; others show condition groups or visual branches. Mailchimp, for example, defines AND as matching every condition and OR as matching one or more conditions, while advanced builders can combine those relationships in nested groups. Mailchimp’s explanation of advanced segmentation logic is a useful illustration of the underlying model.
Start with the audience sentence, not the segment builder
Write the intended audience in plain language before selecting filters. If the sentence is unclear, the rule will probably be unclear too.
For example:
- “Send this replenishment reminder to subscribed customers who bought coffee beans in the past 45 days and have not bought them again in the past 21 days.”
- “Invite subscribed UK customers who have attended a webinar or downloaded the implementation guide, but exclude customers with an open support escalation.”
That wording exposes the decisions that matter: subscription status, geography, qualifying behaviour, timing and exclusions. It also gives the team something meaningful to review before a campaign is scheduled.
A segment should answer one question: what must be true for this person to receive this specific email now?
What AND and OR actually mean
Each contact is tested against a set of conditions. An AND rule makes the segment narrower; an OR rule makes it broader.
| Rule | Meaning | Example result |
|---|---|---|
| A AND B | The contact must meet both conditions. | Subscribed and purchased in the last 90 days. |
| A OR B | The contact can meet either condition, or both. | Interested in trail running or road running. |
| NOT A | The contact must not meet the condition. | Has not purchased in the last 30 days. |
Suppose a campaign is intended for people in Manchester who are interested in either workshops or private coaching. The correct logic is:
Location = Manchester AND (Interest = workshops OR Interest = private coaching)
The brackets matter. Without them, many systems would interpret a loose sequence as:
(Location = Manchester AND Interest = workshops) OR Interest = private coaching
That could include every contact interested in private coaching, regardless of location. This is why complex segments should be built as groups, rather than as a long unstructured line of filters.
Use OR for equivalent paths into one audience
OR is useful where more than one signal genuinely qualifies someone for the same message. It works best when the alternatives have the same meaning from the recipient’s perspective.
For a webinar follow-up, these may be equivalent paths:
Attended webinar OR watched the on-demand recording
Both groups have shown interest in the same topic, so a next-step resource may be relevant to either. Similarly, an apparel brand might use:
Favourite category = outerwear OR favourite category = knitwear
when promoting a seasonal collection containing both.
Be more cautious when OR joins unrelated conditions. A rule such as:
Clicked an email in the past 30 days OR has never purchased OR lives in London
is technically valid, but it describes no coherent audience. It will usually be much larger than expected and gives little guidance on message, offer or frequency.
Use AND to add safeguards and relevance
AND is how a broad population becomes a campaign audience. It is particularly useful for adding requirements that should apply to everyone, such as marketing permission, product eligibility or a contact-pressure limit.
A campaign for a feature available only on a particular plan might be defined as:
Marketing status = subscribed AND plan = Pro AND feature X = enabled
A re-engagement message might use:
Marketing status = subscribed AND last meaningful engagement is more than 90 days ago AND received fewer than 3 marketing emails in the past 14 days
The final condition is important. A contact can be eligible for several campaigns at once. Segment membership alone does not prevent overlapping sends, so a contact-pressure rule or campaign-priority process is often needed to prevent several teams reaching the same person in a short period.
Build segments in layers
A reliable way to handle nested logic is to separate the segment into layers.
1. Establish the sendable population
Start with rules that apply to every marketing send:
Subscribed AND not globally suppressed AND email address is deliverable
Exact fields vary by platform, but the principle should not. Unsubscribes, hard bounces, complaints and internal do-not-contact records must override promotional targeting rules. In the UK, the ICO advises organisations to maintain a suppression list and screen new marketing lists against it, rather than simply deleting opt-out records. The ICO’s guidance on respecting people’s preferences explains why this helps organisations honour objections consistently.
Permission is not an attribute to add halfway through a segment. It is the boundary around the whole activity.
2. Add the campaign’s qualifying conditions
Next, define the behaviour, profile or lifecycle state that makes the message relevant:
(Bought category A in the past 180 days OR viewed category A at least twice in the past 30 days)
This group creates two legitimate routes into the audience: recent customers and high-intent browsers.
3. Apply exclusions
Then exclude people for whom the message would be inappropriate or duplicative:
AND not purchased category A in the past 14 days AND no open customer-service case
The finished logic is:
Sendable AND (recent buyer OR high-intent browser) AND not recent purchaser AND no open service case
Writing it this way makes it easier to inspect. It also makes it clear that exclusions apply to both the buyer and browser paths.
Be precise about time windows
Time is part of the logic, not a footnote. “Purchased recently” needs a defined window, and that window should match the customer journey. A seven-day exclusion may be suitable for a digital product confirmation; it may be far too short for a high-consideration purchase or too long for a consumable product.
There are three common timing errors:
- Using mismatched windows. “Viewed in the last 180 days” combined with “did not purchase in the last 14 days” may include people whose interest has long passed.
- Forgetting that rolling dates move. A saved segment based on “last 30 days” changes every day. That is useful for automation, but it may surprise a team expecting a fixed campaign audience.
- Using dates that cannot prove sequence. A customer may have both viewed and bought a product, but separate filters may not show whether the view happened before the purchase. Where sequence matters, use event data or an automation trigger that can evaluate it.
Dynamic segments normally recalculate as contact data changes; Mailchimp’s developer documentation, for example, describes saved segment membership as reflecting the conditions evaluated against contacts at the present time. Its segment documentation also distinguishes those rule-based segments from static segments whose membership changes only when someone is manually added or removed.
For a one-off campaign, decide whether you need a live audience at send time or a fixed snapshot for approval and reporting. Neither is inherently better. The choice depends on whether eligibility should continue changing up to the moment of send.
Negative conditions can include more people than expected
Rules such as “country is not France” or “interest does not contain cycling” look straightforward. The complication is missing data. In many systems, a contact with an empty country or interest field may also satisfy a negative condition.
Mailchimp specifically notes that operators such as “is not” and “does not contain” can include blank field values in some segmentation contexts. Its operator guidance within the advanced segmentation documentation is a useful reminder to test this behaviour in the platform being used.
If the campaign genuinely requires known data, state that positively:
Country is not blank AND country is not France
Likewise, “has not purchased” is not the same as “is a prospect”. It can include contacts with incomplete order data, very old customers, people who purchased through an unconnected channel, or recipients for whom the platform has no recorded transaction. Treat negative behavioural rules as data-dependent, rather than as a reliable description of intent.
Do not let an OR rule bypass vital exclusions
One of the most damaging segmentation mistakes is placing an OR at the top level when a safety rule was intended to apply to everyone.
Consider:
Subscribed AND clicked in the past 30 days OR purchased in the past 30 days
Depending on the builder’s grouping, a recent purchaser may be included even if they are no longer subscribed. The safer structure is:
Subscribed AND (clicked in the past 30 days OR purchased in the past 30 days)
The same applies to suppression, geography, age restrictions, account status and frequency caps. Put universal rules outside the OR group. Put alternatives inside it.
Engagement data needs a careful interpretation
Engagement can make a segment more relevant, but it should not be treated as a perfect measure of human attention. Opens are particularly limited: Google says it does not track open rates and cannot verify the accuracy of rates reported by third parties. Google’s sender guidelines also recommends monitoring recipient feedback, authentication and spam rates rather than relying on opens alone.
Where possible, give more weight to actions that are closer to the message’s purpose: a recent click to a relevant category, a logged-in product action, a purchase, a preference-centre choice or an event registration. Use several signals where that is proportionate, rather than treating one open as proof that a recipient wants every campaign.
Segmentation also supports deliverability when it reduces unwanted mail. Gmail’s guidance says senders should email people who want their messages, make unsubscribing easy and, for larger senders, meet specific authentication and unsubscribe requirements. Review the current Gmail sender guidelines alongside campaign segmentation; relevant targeting is not a substitute for sound authentication, consent and unsubscribe processes.
Test the audience before you send
A segment count is a warning signal, not validation. A plausible-looking total can still conceal flawed logic. Before sending, inspect a small sample of included contacts and ask why each one qualified. Then inspect people who should clearly be excluded.
Useful test cases include:
- a subscribed contact who matches both sides of an OR rule;
- a contact who matches one side only;
- a recent purchaser who should fall into an exclusion window;
- an unsubscribed or suppressed contact who otherwise meets every targeting condition;
- a contact with a blank value for a field used in a negative rule;
- a person eligible for another campaign scheduled at the same time.
Compare the new segment count with a simple baseline, such as all subscribed contacts in the relevant market. A sudden expansion after adding a condition is often a sign that AND and OR have been grouped incorrectly. A sudden collapse may mean that one field is sparse, stale or defined differently than expected.
For complex, high-volume programmes, keep a short record of the segment’s purpose, logic, data source, owner, exclusions and review date. This makes it possible to revisit the rule when a product name, lifecycle definition or preference model changes.
When segmentation becomes a deliverability control
Audience logic is more than personalisation. It governs contact pressure and helps limit campaigns to people for whom the message is timely and expected. That matters when a sender is trying to reduce complaints, recover from weak engagement or understand why a particular mailbox-provider audience is responding poorly.
In that situation, an independent review should examine the segment definitions alongside suppression handling, consent records, authentication, sending volume and provider-level feedback. Email Foundry’s deliverability work can include audience verification, suppression checks, likely-human engagement filtering and contact-pressure controls where those are relevant to a permission-based sending programme. The aim is not to find a cleverer way to reach unwilling recipients; it is to ensure that eligible recipients receive fewer, more appropriate messages.
AND/OR logic is simple Boolean maths. The difficult part is agreeing what each condition means operationally, keeping the supporting data trustworthy and making sure the final rule respects every preference and exclusion. When those foundations are in place, the segment builder becomes a dependable control rather than a risky last-minute filter.
Frequently asked questions
Should subscription status be inside every email segment?
For marketing sends, it should be treated as a universal eligibility rule, alongside global suppression and deliverability exclusions. Put it outside any OR group so that no alternative behaviour or profile condition can bypass it.
What is the difference between a dynamic segment and a static segment?
A dynamic segment recalculates membership when contact data changes. A static segment is a fixed group whose membership changes only when someone is explicitly added or removed. Use a dynamic segment when eligibility should update automatically; use a static snapshot when the campaign audience needs to remain fixed.
Why does an email segment include contacts with blank fields?
Many platforms treat negative operators differently from positive ones. For example, a condition such as “country is not France” may include contacts with no country recorded. Check the platform’s operator rules and add an explicit “country is not blank” condition if known data is required.
Can open rate be used to identify engaged contacts?
It can be one input, but it is not a complete measure of engagement. Use it cautiously and, where possible, combine it with clicks, purchases, site activity, preference selections or other meaningful actions.
Sources and further reading
- Understanding logic in the advanced segment builder — Mailchimp
- Segments: Mailchimp Marketing API documentation — Mailchimp
- Email sender guidelines — Google
- Respect people’s preferences — Information Commissioner’s Office
- How do we comply with the PECR electronic mail marketing rules? — Information Commissioner’s Office