Introduction
Dittofeed provides a self-contained subscription management page that can be served directly from the API. This is useful for deployments where you only expose/api/public/* endpoints (e.g., Kubernetes ingress configurations that don’t expose the dashboard’s static assets).
The page is served from /api/public/subscription-management/page and includes all CSS and JavaScript inline, requiring no external dependencies.
Self-Contained Page Endpoint
Endpoint
Query Parameters
| Parameter | Required | Description |
|---|---|---|
w | Yes | Workspace ID |
i | Yes | User identifier value |
ik | Yes | Identifier key (e.g., email, userId) |
h | Yes | Cryptographic hash for authentication |
s | No | Subscription group ID (for single subscription change on load) |
sub | No | Subscription action: 1 to subscribe, 0 to unsubscribe |
isPreview | No | Set to true to preview the page without making changes |
Response
The endpoint returns a complete HTML page (Content-Type: text/html) with:
- Inline CSS for styling
- Inline JavaScript for interactivity
- Server-rendered subscription data
Example URL
Custom Templates
You can customize the subscription management page by uploading a custom Liquid template via the admin API.Template API Endpoints
Get Current Template
null if using the default.
Upsert Template
Delete Template (Reset to Default)
Template Variables
Your Liquid template has access to the following variables:| Variable | Type | Description |
|---|---|---|
workspaceName | string | Name of the workspace |
channels | array | Array of channel objects |
subscriptionChange | string | "Subscribe" or "Unsubscribe" if a change occurred |
changedSubscriptionName | string | Name of the subscription that changed |
changedSubscriptionChannel | string | Channel of the subscription that changed |
isPreview | boolean | Whether this is a preview render |
subscriptionDataJson | string | JSON data for JavaScript initialization |
Channel Object
Custom Liquid Tags
subscription_hidden_fields
The subscription_hidden_fields tag is a custom Liquid tag available only in subscription management page templates. It renders the hidden form fields required for form submission authentication.
<form> element.
The tag renders:
CSS Class API
The JavaScript behavior attaches to specific CSS classes. Your custom template must include elements with these classes for the interactive features to work.Required Classes
| Class | Element | Description |
|---|---|---|
df-subscription-form | <form> | Main form container. Handles form submission. |
df-subscription-checkbox | <input type="checkbox"> | Individual subscription checkboxes. Requires data-subscription-id and data-channel attributes. |
df-channel-toggle | <input type="checkbox"> | Channel-level toggle. Requires data-channel attribute. Toggles all subscriptions in the channel. |
df-save-button | <button> | Save button. Triggers API call to save preferences. |
df-loading-indicator | any | Shown while saving. Hidden by default. |
df-success-message | any | Shown on successful save. Hidden by default. |
df-error-message | any | Shown on save error. Hidden by default. |
Data Attributes
| Attribute | Used On | Description |
|---|---|---|
data-subscription-id | df-subscription-checkbox | The subscription group UUID |
data-channel | df-subscription-checkbox, df-channel-toggle | The channel name (e.g., “Email”, “SMS”) |
Example HTML Structure
JavaScript Behavior
The page automatically initializes subscription data fromwindow.__SUBSCRIPTION_DATA__. Your template should include this at the bottom of the body:
- Channel Toggle Logic: When a channel toggle is checked/unchecked, all subscriptions in that channel are updated accordingly.
- Individual Subscription Logic: When an individual subscription is toggled, the channel toggle is updated (checked if all subscriptions are checked, unchecked otherwise).
-
Save Functionality: Clicking the save button or submitting the form sends a PUT request to
/api/public/subscription-management/user-subscriptionswith the updated subscription states. - UI Feedback: Loading, success, and error indicators are shown/hidden automatically during the save process.
Default Template Reference
Below is the default template that Dittofeed uses when no custom template is configured. You can use this as a starting point for your own customizations:Example Custom Template
Below is a simpler custom template example that you can use as a starting point:Use Cases
Kubernetes Ingress Restriction
If your Kubernetes ingress only exposes/api/public/* paths, you can use the self-contained page endpoint instead of the default dashboard page:
/api/public/subscription-management/page will receive a fully functional subscription management page without requiring access to dashboard static assets.
Branded Subscription Pages
Use custom templates to match your brand:- Custom colors and typography
- Your company logo
- Custom messaging and copy
- Localized content

