Skip to content

Preference Center

The Preference Center is a self-service portal where subscribers manage their own email preferences. It is DSGVO/DSG-compliant by design: subscribers can view their data, update tag subscriptions, export all stored data, and delete their account.

Generate a subscriber token

Access to the Preference Center is secured with short-lived tokens. Generate a token for a subscriber and share the resulting URL.

token_response = await client.subscribers.generate_token("subscriber-id")
url = f"https://subscribeflow.net/preferences?token={token_response.token}"
print(f"Preference Center link: {url}")
const tokenResponse = await client.subscribers.generatePreferenceToken(
  'subscriber-id',
);
const url = `https://subscribeflow.net/preferences?token=${tokenResponse.token}`;
console.log('Preference Center link:', url);
curl -X POST \
  https://api.subscribeflow.net/api/v1/subscribers/SUBSCRIBER_ID/preference-token \
  -H "X-API-Key: sf_live_..."

Include the Preference Center link in your emails so subscribers can manage their preferences at any time.

Redirect URL pattern:

https://subscribeflow.net/preferences?token=TOKEN

You can also embed the Preference Center in your own application by redirecting to this URL or opening it in an iframe.

Tip

Add the preference link to the footer of every email you send. MJML example:

<mj-text>
  <a href="{{preference_center_url}}">Manage your preferences</a>
</mj-text>

What subscribers can do

Once a subscriber opens the Preference Center, they can:

  • View subscribed tags -- see all tags they are currently subscribed to
  • Subscribe to new tags -- browse public tags and opt in to additional interests
  • Unsubscribe from tags -- remove themselves from any tag
  • Export their data -- download all stored data as JSON (DSGVO Art. 20)
  • Delete their account -- permanently remove all data (DSGVO Art. 17)

Programmatic access

You can also perform these actions via the API using a subscriber token.

# Get preferences
pref_center = client.preference_center(token_response.token)
info = await pref_center.get_preferences()
print(f"Subscribed to: {len(info.subscribed_tags)} tags")
print(f"Available: {len(info.available_tags)} tags")

# Subscribe to a tag
await pref_center.subscribe_tag("tag-id")

# Unsubscribe from a tag
await pref_center.unsubscribe_tag("tag-id")

# Export all data
export = await pref_center.export_data()

# Delete account
await pref_center.delete_account()
// Get preferences
const prefCenter = client.preferenceCenter(tokenResponse.token);
const info = await prefCenter.getInfo();
console.log('Subscribed to:', info.subscribed_tags.length, 'tags');
console.log('Available:', info.available_tags.length, 'tags');

// Subscribe to a tag
await prefCenter.subscribeTag('tag-id');

// Unsubscribe from a tag
await prefCenter.unsubscribeTag('tag-id');

// Export all data
const exportData = await prefCenter.exportData();

// Delete account
await prefCenter.deleteAccount();
# Get preferences
curl https://api.subscribeflow.net/api/v1/preference-center \
  -H "Authorization: Bearer PREFERENCE_TOKEN"

# Subscribe to a tag
curl -X POST https://api.subscribeflow.net/api/v1/preference-center/tags/TAG_ID/subscribe \
  -H "Authorization: Bearer PREFERENCE_TOKEN"

# Unsubscribe from a tag
curl -X POST https://api.subscribeflow.net/api/v1/preference-center/tags/TAG_ID/unsubscribe \
  -H "Authorization: Bearer PREFERENCE_TOKEN"

# Export data
curl https://api.subscribeflow.net/api/v1/preference-center/export \
  -H "Authorization: Bearer PREFERENCE_TOKEN"

# Delete account
curl -X DELETE https://api.subscribeflow.net/api/v1/preference-center/account \
  -H "Authorization: Bearer PREFERENCE_TOKEN"

Custom domain setup

On the Professional plan, you can serve the Preference Center from your own domain.

Step 1: Add a CNAME record pointing to SubscribeFlow:

preferences.your-domain.com  CNAME  pref.subscribeflow.net

Step 2: Configure the custom domain in your Dashboard under Settings > Preference Center > Custom Domain.

Step 3: SubscribeFlow provisions a TLS certificate automatically. Once DNS propagates, your preference links use the custom domain:

https://preferences.your-domain.com/preferences?token=TOKEN

Info

Custom domain support requires the Professional plan (CHF 49/month). See Plans & Billing for details.

DSGVO/DSG compliance features

SubscribeFlow is designed for DSGVO (EU) and DSG (Switzerland) compliance:

Feature DSGVO Article Description
Data export Art. 20 (Portability) Subscribers can export all stored data as JSON
Account deletion Art. 17 (Right to erasure) Permanent deletion of all subscriber data
Preference transparency Art. 13/14 (Information) Subscribers see exactly what tags they are subscribed to
Self-service management Art. 7(3) (Withdrawal) Subscribers can withdraw consent at any time
Audit trail Art. 30 (Records) All subscription changes are logged with timestamps

Hands-On: Add preference management to your app

Generate a token and send a preference link to a subscriber.

import asyncio
from subscribeflow import SubscribeFlowClient

async def main():
    async with SubscribeFlowClient(api_key="sf_live_...") as client:
        # 1. Create a subscriber
        subscriber = await client.subscribers.create(
            email="alice@example.com",
            tags=["newsletter"],
        )

        # 2. Generate a preference token
        token = await client.subscribers.generate_token(subscriber.id)
        url = f"https://subscribeflow.net/preferences?token={token.token}"

        # 3. Send the link via email
        await client.emails.send(
            template_slug="preference-invite",
            to=subscriber.email,
            variables={"preference_center_url": url},
        )
        print(f"Preference link sent to {subscriber.email}")

asyncio.run(main())
import { SubscribeFlowClient } from '@subscribeflow/sdk';

const client = new SubscribeFlowClient({
  apiKey: 'sf_live_...',
});

// 1. Create a subscriber
const subscriber = await client.subscribers.create({
  email: 'alice@example.com',
  tags: ['newsletter'],
});

// 2. Generate a preference token
const token = await client.subscribers.generatePreferenceToken(
  subscriber.id,
);
const url = `https://subscribeflow.net/preferences?token=${token.token}`;

// 3. Send the link via email
await client.emails.send({
  template_slug: 'preference-invite',
  to: subscriber.email,
  variables: { preference_center_url: url },
});

console.log('Preference link sent to', subscriber.email);
# 1. Create a subscriber
SUBSCRIBER_ID=$(curl -s -X POST https://api.subscribeflow.net/api/v1/subscribers \
  -H "X-API-Key: sf_live_..." \
  -H "Content-Type: application/json" \
  -d '{"email": "alice@example.com", "tags": ["newsletter"]}' \
  | jq -r '.id')

# 2. Generate a preference token
TOKEN=$(curl -s -X POST \
  "https://api.subscribeflow.net/api/v1/subscribers/$SUBSCRIBER_ID/preference-token" \
  -H "X-API-Key: sf_live_..." | jq -r '.token')

echo "Preference Center URL: https://subscribeflow.net/preferences?token=$TOKEN"