Sub topic 10
Suppressing instead of deleting, and keeping records
This chapter assumes you know the basic email terms (list, bounce, unsubscribe), send through an email service provider (ESP), and can read simple SQL. By now your policy decides who reaches the end of the sunset flow. This chapter covers what happens to those people next.
Suppress, don't delete
A suppressed address stays in your database, but your system will not send to it. A deleted address is gone. Deleting looks tidy, but it causes three problems.
- The address can come back. If the person signs up again, or an old import loads the address, nothing tells you they were sunset. They get mail again, and the cycle restarts.
- You lose your proof. If someone complains or asks why they stopped getting mail, you have no record of what you did.
- You lose history. You can't measure whether the sunset helped or find people who later return.
Suppression keeps the address and a reason code. Every send job checks the suppression list before it sends.
What to store
Keep a small, fixed set of fields for each suppression. Without a reason code you can't tell a sunset from a hard bounce or an unsubscribe, and each needs different handling.
| Field | Purpose |
|---|---|
| `subscriber_id` | Links back to the subscriber record |
| `reason` | `sunset`, `unsubscribe`, `hard_bounce`, `complaint` |
| `suppressed_at` | When the suppression took effect |
| `policy_version` | Which version of the sunset policy applied |
| `last_engaged_at` | Last click or purchase at the time of suppression |
| `reengagement_sent_at` | Proof the person was warned |
Storing policy_version matters. If you change the window from 180 to 120 days later, you can still explain why an older record was suppressed.
Writing the suppression
The next example moves subscribers who finished the grace period into a suppression table. It runs in PostgreSQL. It uses the stage logic from the earlier chapter and writes the evidence in the same step.
CREATE TABLE IF NOT EXISTS suppressions (
subscriber_id bigint PRIMARY KEY,
reason text NOT NULL,
suppressed_at timestamptz NOT NULL DEFAULT now(),
policy_version text NOT NULL,
last_engaged_at timestamptz,
reengagement_sent_at timestamptz
);
INSERT INTO suppressions
(subscriber_id, reason, policy_version, last_engaged_at, reengagement_sent_at)
SELECT s.id,
'sunset',
'v1-180d-30d',
MAX(e.occurred_at),
s.reengagement_sent_at
FROM subscribers s
LEFT JOIN engagement_events e
ON e.subscriber_id = s.id
AND e.event_type IN ('click', 'purchase')
WHERE s.status = 'subscribed'
AND s.reengagement_sent_at < now() - interval '30 days'
GROUP BY s.id, s.reengagement_sent_at
HAVING MAX(e.occurred_at) IS NULL
OR MAX(e.occurred_at) < s.reengagement_sent_at
ON CONFLICT (subscriber_id) DO NOTHING;
UPDATE subscribers
SET status = 'suppressed'
WHERE id IN (SELECT subscriber_id FROM suppressions WHERE reason = 'sunset')
AND status = 'subscribed';The HAVING clause keeps anyone who clicked or bought after the re-engagement message. ON CONFLICT DO NOTHING makes the job safe to run twice. Run both statements in one transaction so a failure can't leave a suppression without a status change.
The lifecycle of a suppressed address
Suppression is a state, not a dead end. A person who later clicks a link in your site or signs up again should be able to return.
Re-subscribing
Do not move someone back to active just because they appear on a new import. Require a clear new opt-in, such as a signup form or a confirmation email. Then record the date and clear the sunset suppression, but keep the old row in a history table. Never lift a suppression for unsubscribe, hard_bounce, or complaint without a new opt-in. For hard bounces, also confirm the address works.
Retention and privacy
Records are personal data. Keep them only as long as you need them. Many teams keep suppression records for years, because the record's purpose is to prevent future sending. Check your local privacy rules, such as GDPR, since they can require you to honor an erasure request. A common approach is to store a hash of the email address instead of the plain address, so you can still block it without keeping the readable address. Ask your legal contact before choosing a retention period.
Exercise
A subscriber was suppressed under your sunset policy six months ago. Today the same address appears in a new import file from a trade show. What should happen, and why?
Show answer
Keep the suppression in place. The import is not a fresh opt-in by that person, so the address must not return to active. Check the suppression table before sending. If the person confirms through a signup form or confirmation email, record the new opt-in, clear the sunset suppression, and keep the old row in a history table.
Exercise
Why does the suppression table store policy_version and reengagement_sent_at?
Show answer
policy_version lets you explain later which rules applied, even after the window or grace period changes. reengagement_sent_at is evidence that the person was warned before suppression.