MAILCRAFT
Home Features Pricing About Blog Contact Log in Get Started →
Email segmentation & personalization

AND, OR, NOT Segmentation: Building a Segment Step by Step

Wydrukowany harmonogram wysyłek newslettera i smartfon

Segmentation is not an extra feature in a sending tool. It is the decision about who gets the message and why that person specifically. Three logical operators – AND, OR, NOT – are enough to describe almost any audience you actually need. A segment is a filter over the contact database, not a copy of it. The data stays in one place and you look at it through a different window. Sending to the whole list looks like a time saver, but you pay for it with sender reputation: bounces go up, opens go down, and filters at the large mailbox providers react faster than you can stop the campaign. A segment also keeps you compliant. A contact without valid consent drops out of the result before it ever reaches the queue.

Why you need logical operators in segmentation

The difference between a list and a segment is practical, not academic. A list is a set of addresses that has to be maintained by hand. A segment is calculated at the moment of sending, so it always shows the current state of the database. A contact who unsubscribed yesterday is gone today. Without any action from you.

Operators give you a precision that tags will never match. AND narrows: every condition you add cuts off a piece of the set. OR widens, because alternatives add up. NOT removes – it takes whatever came out of the rest of the expression and strips the indicated group out of it.

On the deliverability side it works simply. Sending to everyone means almost certainly hitting dead mailboxes, abandoned addresses and people who do not remember where they know you from. Large providers look at the ratio of engaged to unengaged recipients. That ratio breaks after one careless campaign and takes weeks to rebuild.

And then there is the legal side. A segment lets you cut off contacts without documented consent before they land in the queue. Cheaper than explaining the matter after the fact.

Three operators and what exactly they do

AND requires all conditions to be met at once. The result is always smaller than or equal to the narrowest of them. If the condition “industry = logistics” returns a thousand contacts and “clicked in the last 90 days” returns three hundred, their conjunction will not exceed three hundred.

OR is satisfied by a single matching condition. Every criterion you add either grows the set or leaves it unchanged. It never shrinks it.

NOT is exclusion. And here is the catch: it works on the result of the whole expression, not on a single field. That is why its position in the construction matters.

The most common mistake? Mixing AND and OR without brackets. Take this condition: city Warsaw OR Krakow AND active within 30 days. Depending on how the brackets are placed you get completely different sets:

  1. Warsaw OR (Krakow AND active) – everyone in Warsaw plus active people in Krakow. The widest set, because the Warsaw part goes through with no activity filter.
  2. (Warsaw OR Krakow) AND active – active people from both cities. This is usually what the author meant.
  3. Warsaw AND Krakow AND active – the result of swapping OR for AND by accident. Zero contacts, because nobody lives in two cities at once.

Three arrangements, three different counts. The engine will not guess what you had in mind. A bracket is cheaper than a send to the wrong group.

The data you can actually segment on

You can only build a condition on what you have in the database. The material falls into three kinds.

Custom contact fields: country, city, industry, job title, order value, date of last purchase. You fill them in at signup, on import or through an integration with your shop or CRM system.

Sending events: open, click, no reaction over a given period, hard bounce, soft bounce, unsubscribe. This is data the system produces itself, so it is the most trustworthy.

Technical metadata: recipient domain, signup source, date and method of consent, IP address from the form. Without them you will build neither a sensible spread of your sending nor a segment you can defend during an audit.

A segment is only as good as the data underneath it. A field filled in for one fifth of the database is not fit for an AND condition, because it will cut out everyone where simply nobody entered anything. For OR it will still do. For the core of a segment it will not.

Tip: before you open the builder, check the field coverage in your database. That coverage is decided at import, which is why it pays to map CSV columns to the right fields from the start. Remember too the difference between an empty field and a field holding an empty value – in most engines these are two different states, and the condition “not equal to X” behaves differently in each. Not sure? Test both variants on a small set.

Building a segment step by step

The order is always the same. And do not start by clicking.

  1. Name the goal in one plain sentence. “I want to reach customers in the logistics industry who bought within the last year and responded to emails.” Write the sentence before you open the builder.
  2. Translate the sentence into conditions. Nouns become fields, conjunctions become operators. “And” is AND, “or” is OR, “without” and “except” are NOT. This conversion takes a minute and catches contradictions.
  3. Build the core on AND. A group of conditions that must always be met. Only fields with good coverage go in here.
  4. Add alternatives in a separate OR group and close it in brackets. Put the brackets in even when the interface seems not to require them.
  5. Add the NOT exclusions at the end. Unsubscribes, hard bounces, contacts without confirmed consent, addresses from the previous round of the same campaign.
  6. Check the count, then look at a sample. A dozen or so contacts from the result, reviewed by eye. The number alone confirms nothing – only the view of specific addresses shows whether the filter caught what you were after.
  7. Save it under a name that says what the segment contains. “Logistics, purchase within 12 months, engaged” instead of “segment 3”. In six months you will thank yourself.

If the count is off by an order of magnitude from what you expected, go back to point two. Almost always the fault is in the brackets.

The exclusions people forget

Exclusions are the most overlooked part of a segment. And at the same time the part that moves deliverability the most.

  • Hard bounces have to drop out automatically. Sending again to a mailbox that does not exist is a clear signal to filters that you do not maintain list hygiene.
  • Soft bounces across several sends in a row should be treated as hard ones. A mailbox that has been full for months is usually abandoned.
  • Contacts inactive for many months: either a separate win-back campaign, run deliberately and at low volume, or NOT in every ordinary send. At some point it is worth deciding whether such a contact is still worth keeping at all.
  • Role addresses such as info@, office@, contact@. Weak response, frequent traps, no specific person on the other side.
  • Your own company domains and test mailboxes. Your team opens every email, which artificially inflates the statistics and distorts your read of the campaign.

Tip: do not rewrite this list for every campaign. Build one exclusion group as a ready base segment and attach it with the NOT operator to everything you send. You update it in one place, it works everywhere.

Segmentation, consent and GDPR

A segment does not replace a legal basis. Consent has to be documented separately for each channel and each purpose. Consent for a newsletter does not cover SMS, and consent for product information does not cover a partner’s offer.

In B2B it is the same. Polish electronic communications law, PKE article 398, requires consent for marketing communication towards companies as well. The address office@ on a company domain is not an exception, even though it often gets treated as one.

That is why the date and source of consent should be fields in the database, not a note in a spreadsheet. Without them you will not build a segment you can defend when someone asks about the basis for the send. The email address alone proves nothing.

Contacts from purchased databases, or imported without any consent history, stay under NOT until consent is renewed in a way you record. This is not excessive caution. It is the only way such a database will ever become usable.

The right to object takes effect immediately. An unsubscribe has to remove the contact from all segments at once, not only from the one the message came from. If your tool requires removing them from each list separately, that is not a convenience question but a risk one.

How segments affect deliverability

A narrower segment with real interest produces a higher open rate, and that is a positive signal for filters. The mechanism is direct: providers judge how recipients react to your mail and carry that judgement over to the next sends from the same domain and the same IP.

When warming up a new IP and a new sending domain, segmentation is the basic tool. You start with the most engaged, add further groups gradually, and watch the server responses along the way. The reverse order ends in a block in the first week.

From our practice with our own fleet of sending servers: getting out of a block at a large filter always started with narrowing the database, never with raising volume. A few sends to a narrow, active group rebuilds the signal faster than any changes to the content.

The foundation has to be in place first: SPF, DKIM, DMARC, a correct Return-Path and a PTR matching the host name. That is the entry condition, not an optimisation. Segmentation only works on that ground – without authentication, the best segment will not help.

Segmentation by recipient domain is useful too. It lets you spread the send over time and avoid a sudden traffic spike at one provider, which tends to be treated as an anomaly regardless of content quality. Want full control over this? Take a look at our email marketing platform with its own sending servers – keeping the infrastructure close to the segment configuration simplifies diagnosis when something stops getting through.

Summary: a segment as a decision, not a filter

AND narrows, OR widens, NOT protects. The build order is always the same: core, alternatives, exclusions. You start with a sentence in plain language and finish by verifying the result on live contacts.

Keep exclusions in one place and attach them to every campaign. A segment is only as credible as the data and the consents underneath it – no logical operator will fix an empty field or a missing legal basis. It is worth checking what segment building options a tool offers before you plan your whole communication on it.

Checklist before sending:

  • The goal of the send written down in one sentence.
  • The conditions match that sentence.
  • Brackets placed explicitly, not by default.
  • Exclusions attached with the NOT operator.
  • The count matches expectations.
  • A sample of contacts reviewed by hand.

Six points, a few minutes. That is the distance between a considered campaign and a send you spend a month undoing.