Sub topic 1
What consent means for an email list
This chapter defines consent for an email list and shows how it differs from a customer simply having your address. It also sets out what evidence you need to keep. Later chapters build the flows that produce and protect that consent.
Prerequisites
This chapter assumes you know the following:
- How email sending works at a basic level, and what an HTML marketing email is.
- HTTP GET and POST requests and how web forms submit data.
- Basic SQL and one general-purpose programming language. The examples use SQL and Python.
- What spam complaints and sender reputation are.
No legal training is needed. This chapter is not legal advice. Check the rules that apply to your senders and recipients with a qualified person.
Consent is more than having an address
Having someone's email address does not mean you may send them marketing. An address can reach you in many ways: a purchase, a support request, a business card, a purchased list, or a scraped web page. Only some of those routes involve the person agreeing to receive marketing from you.
For a list, consent means the person did a deliberate, identifiable act that shows they want a specific kind of email from a specific sender. Four properties matter in practice.
| Property | What it means | Example of failing it |
|---|---|---|
| Specific | The person agreed to a named sender and a described kind of email. | One checkbox that covers "offers from us and our partners" without naming anyone. |
| Informed | The wording at the moment of signup said what they would receive and how often. | A form that only says "Submit". |
| Freely given | Joining was not hidden inside another action or made a condition of something unrelated. | A pre-ticked box on a checkout page. |
| Provable | You can show when, where, and under what wording it happened. | A list imported from a spreadsheet with no history. |
The last property is the one engineers control most directly. A subscriber who agreed but left no evidence is, for most practical purposes, a subscriber who did not.
Consent belongs to a purpose
Consent is tied to what was promised. Someone who signs up for a weekly digest has not agreed to event invitations or partner offers. If you later want to send a new kind of email, you either need fresh consent or a clear legal basis that covers it.
This is why the data model in later chapters stores the signup source and the consent text next to each event. It is also why a preference centre matters. It lets people grant, narrow, or withdraw consent for each purpose without a blunt all-or-nothing choice.
Express and implied consent
Two terms come up often in policy documents.
- Express consent is an explicit action, such as typing an address into a form that says "Send me the weekly digest" and submitting it.
- Implied consent is inferred from a relationship or behaviour, such as an existing customer relationship. Where it is allowed at all, it is usually narrower and may expire.
Rules differ between jurisdictions, and the next chapter covers them. For design purposes, treat express consent with a recorded action as your default. It is the easiest to defend and the least likely to need rework when rules change.
Withdrawing consent
Consent is only meaningful if it can be taken back. A subscriber must be able to withdraw as easily as they gave it. If signup takes one click, withdrawal should not need a login, a phone call, or a long form.
Withdrawal has a technical consequence. Once someone unsubscribes, your system must remember that, not just delete the row. If an unsubscribed address is later re-imported from another source, you need a record that tells you not to send. The suppression list chapter covers that.
Consent as a state with evidence
For engineering purposes, consent is two things stored together: the current state and the history behind it. The current state answers "may I send to this address now?" The history answers "how do I know?"
The schema below is a minimal version of this idea. The subscribers table holds the state. The consent_events table is append-only and holds the evidence.
CREATE TABLE subscribers (
id BIGSERIAL PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
status TEXT NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending', 'confirmed', 'unsubscribed')),
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
confirmed_at TIMESTAMPTZ
);
CREATE TABLE consent_events (
id BIGSERIAL PRIMARY KEY,
subscriber_id BIGINT NOT NULL REFERENCES subscribers(id),
event_type TEXT NOT NULL
CHECK (event_type IN ('signup', 'confirm', 'unsubscribe', 'preferences_updated')),
source TEXT NOT NULL,
consent_text TEXT,
ip_address INET,
user_agent TEXT,
occurred_at TIMESTAMPTZ NOT NULL DEFAULT now()
);Each column in consent_events answers a question an auditor, a mailbox provider, or an annoyed subscriber might ask.
| Column | Question it answers |
|---|---|
| `event_type` | What happened: signup, confirmation, unsubscribe, or a preference change? |
| `source` | Where did it happen, such as a footer form, a checkout page, or an event registration? |
| `consent_text` | What exact wording did the person see? |
| `ip_address` and `user_agent` | What client made the request? |
| `occurred_at` | When did it happen? |
Store the wording itself, or a version identifier that points to it. Forms change over time. A record saying "signed up via footer form" is weak if you cannot show what the footer form said in March.
What the evidence does not prove
An IP address and a timestamp show that a request arrived. They do not show that the owner of the mailbox made it. Anyone can type another person's address into a form. This is the main weakness of single opt-in, and the reason many senders add a confirmation step. The chapter on single versus double opt-in compares the two.
IP addresses and user agents are also personal data in many jurisdictions. Collect them because you need them as evidence, state this in your privacy notice, and set a retention period.
How consent flows through a list
The diagram shows the path of one address from first contact to a sendable state, and the paths that remove it.
Only Confirmed is a sendable state in this model. A later chapter covers the lifecycle in full, including how single opt-in lists collapse Pending into the signup step.
Common mistakes
These errors come up repeatedly in real systems.
- Treating customers as subscribers. A purchase gives you a transactional relationship. It does not automatically cover newsletters.
- Buying or renting lists. The people on them never agreed to hear from you, and you cannot prove otherwise. Mailbox providers often detect the resulting complaints and spam-trap hits.
- Bundling consent. One checkbox that grants several unrelated permissions is hard to defend as specific.
- Pre-ticked boxes. A default of "yes" is not a deliberate act.
- Losing the wording. Keeping a timestamp but not the text the person agreed to.
- Overwriting history. Updating a single
statuscolumn with no event log. You lose the answer to "how do we know?" - Making withdrawal harder than signup. Requiring a login or several steps to leave.
Writing an event when consent changes
Every change to consent should write an event in the same transaction as the state change. If the state update succeeds and the event insert fails, your evidence is incomplete. If you write the event first and the update fails, your history disagrees with your state.
from datetime import datetime, timezone
def record_signup(db, email, source, consent_text, ip, user_agent):
"""Create a pending subscriber and its signup event in one transaction."""
now = datetime.now(timezone.utc)
with db.transaction():
row = db.query_one(
"INSERT INTO subscribers (email, status, created_at) "
"VALUES (%s, 'pending', %s) "
"ON CONFLICT (email) DO UPDATE SET email = EXCLUDED.email "
"RETURNING id",
(email.strip().lower(), now),
)
db.execute(
"INSERT INTO consent_events "
"(subscriber_id, event_type, source, consent_text, ip_address, user_agent, occurred_at) "
"VALUES (%s, 'signup', %s, %s, %s, %s, %s)",
(row["id"], source, consent_text, ip, user_agent, now),
)
return row["id"]The example assumes a small db wrapper with transaction, query_one, and execute methods, as the later chapters do. Three details matter:
- The email is normalised with
strip().lower()so theUNIQUEconstraint catches duplicates that differ only in case. Domain parts are case-insensitive. Local parts are technically case-sensitive but almost never treated that way. ON CONFLICT ... DO UPDATEreturns the existing id for a repeat signup instead of failing, and the repeat attempt still gets its own event.- A repeat signup does not change
status. A confirmed or unsubscribed subscriber who submits the form again is not silently reset topending. Handling that case properly is part of the lifecycle chapter.
Why this matters for the rest of the build
Everything in the remaining chapters traces back to the properties in this chapter. Double opt-in provides the proof that the mailbox owner acted. Signed tokens make that proof hard to forge. The audit trail makes it durable. One-click unsubscribe and the suppression list make withdrawal real. The preference centre makes consent specific by purpose.
Exercise
A shop imports 5,000 customer emails from its order history and wants to add them all to the weekly newsletter with status confirmed. Give two reasons this is a problem and say what you would do instead.
Show answer
First, a purchase relationship does not show the customer agreed to marketing newsletters, so consent is neither specific nor provable. Second, marking the rows confirmed with no consent_events record means you cannot show when, where, or under what wording anyone agreed, and the status claims a confirmation that never happened. Instead, send order-related messages only as transactional email, and invite customers to subscribe through a form with clear wording. Record a signup event for each one that does, and, for double opt-in, wait for the confirm event before setting the status to confirmed.
Exercise
Why does the consent_events table store consent_text rather than only the signup source?
Show answer
The source says where the person signed up, but not what they were told. Forms and wording change over time, so to show what a person agreed to you need the exact text, or a version identifier that points to it, kept with the event.