Skip to main content

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

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

Returns the current custom template, or null if using the default.

Upsert Template

Delete Template (Reset to Default)

Removes the custom template, reverting to the default.

Template Variables

Your Liquid template has access to the following variables:

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.
This tag is required in your custom template for form submissions to work. Place it inside your <form> element. The tag renders:
Without this tag, the form cannot authenticate the user or identify which workspace the submission belongs to.

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

Data Attributes

Example HTML Structure

JavaScript Behavior

The page automatically initializes subscription data from window.__SUBSCRIPTION_DATA__. Your template should include this at the bottom of the body:
The injected JavaScript handles:
  1. Channel Toggle Logic: When a channel toggle is checked/unchecked, all subscriptions in that channel are updated accordingly.
  2. Individual Subscription Logic: When an individual subscription is toggled, the channel toggle is updated (checked if all subscriptions are checked, unchecked otherwise).
  3. Save Functionality: Clicking the save button or submitting the form sends a PUT request to /api/public/subscription-management/user-subscriptions with the updated subscription states.
  4. 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:
Users accessing /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

Simplified UI

Create minimal templates that only show essential options, removing unnecessary complexity for your users.