NightmailDocs
Docs
Guide

Topics and unsubscribes

Let people stop one kind of marketing email, such as events or product news, and keep the rest.

What a topic is

A topic is a kind of marketing email you send: Product updates, Events, Newsletter. Give a campaign or a marketing send a topic, and its unsubscribe link stops that topic alone: the person keeps getting your other marketing. Unsubscribing from everything is always there too, and it always wins. Transactional email has no topic and no unsubscribe.

Make topics in Audience → Topics. Each has a name and a line of description, both shown to people on the preference page, and decides once, when it’s made, who gets it without having chosen.

Who gets an email with a topic

PersonGets it?
Subscribed to marketing, never choseYes, unless only people who opt in get the topic
Opted out of the topicNo
Opted in to the topicYes
Unsubscribed from all marketingNever, whatever they chose for topics
Suppressed (a bounce or a complaint)Never

A send to someone who opted out of its topic is refused with the reason topic_unsubscribed. A campaign leaves them out of its audience and its counts, and skips anyone who opts out after it was sent but before their email goes, shown in Logs as suppressed. Archiving a topic keeps every opt-out: campaigns already sent with it keep skipping those people.

Sending with a topic

On a campaign, choose the topic under Recipients while you review it. Over the API, set topicId on sendEmail or a sendEmailBatch item with kind: "marketing", or on the campaign’s draft. A required notice has no topic: it has no unsubscribe link.

Over the API

List and make topics with listTopics, createTopic and updateTopic. A contact’s choices are on getContact (topics); record one with updateContactConsent and topicId. Turning a topic back on for someone who opted out needs confirmResubscribe. Every change is in the contact’s consent history and sends a contact.subscription_changed webhook event with topicId.