Hyphen User Guides

Layout & Design Templates

Complete guide to page templates, email templates, section configuration, thumbnail management, and design consistency

Version 1.0|Updated 2026-04-12|QA Teams, Platform Admins, Customer Operators, Implementation Teams

1. Executive Overview

What This Module Does

The Layout & Design — Page & Email Template System provides the complete visual management layer for the Hyphen Publishing Platform. It consists of two interconnected systems:

  1. Page Template System — A visual drag-and-drop page builder that lets admins create, configure, and publish page layouts across 21 page categories (homepage, article, section, author, subscription, search, campaign, archive, shop, etc.). Published templates render on the Reader Portal as the public-facing magazine.

  2. Email Template System — A template management system for all transactional, lifecycle, notification, and marketing emails. Admins can customize email content, branding, and behavior through a WYSIWYG editor with variable substitution, preview, and test-send capabilities.

Who Uses It

UserRole
Admins / EditorsCreate, configure, and publish page templates; customize email templates
Content EditorsUse page templates to organize how content appears on the magazine
Marketing TeamsCreate email campaigns using the template system
ReadersExperience the published page templates on the Reader Portal; receive styled emails
QA TeamsValidate template rendering, email delivery, and configuration workflows

Business Problem Solved

  • Eliminates the need for code changes to modify page layouts or email styling
  • Provides consistent branding across all reader-facing pages and emails
  • Enables non-technical staff to control magazine appearance and communication
  • Supports 20+ page types with 80+ template variants and 176+ section components
  • Centralizes email branding, variable management, and delivery tracking

2. Feature Scope

In Scope

Page Template System

FeatureDescription
Template GalleryBrowse and select from 80+ built-in templates across 21 categories
Visual Drag-Drop EditorCanvas-based editor with section palette, properties panel, and live preview
Section System176+ pre-built section components (hero, grid, list, detail, campaign, etc.)
Section PropertiesConfigurable properties per section (content source, filters, layout, visibility)
Template VersioningMajor/minor version tracking with rollback capability
Template PublishingPublish templates to Strapi CMS for Reader Portal consumption
Page Categories20 database-driven page categories with dynamic management
Static PagesAbout, Privacy, Terms, and custom static page management
Homepage EditorDedicated homepage editing with featured carousel and section management
Banner ManagementPromotional banners with scheduling (start/end dates)
Navigation EditorHeader and footer link management
Theme & AppearanceGlobal theme customization (colors, typography, spacing, header/footer styles)
Campaign Landing PagesTemplate-driven campaign pages
Preview ModePreview templates before publishing with session-based preview API

Email Template System

FeatureDescription
Email Template CRUDCreate, edit, delete, and manage email templates
Variable System{{variable}} substitution in subject and body
Template PreviewIn-editor preview with branding wrapper
Test EmailSend test email per template with [TEST] prefix
Email BrandingGlobal branding (logo, colors, footer, social links) via preferences
Email CampaignsCampaign builder with audience targeting and scheduling
Email LogsFull delivery log with status tracking (sent/failed/bounced)
Template SeedingOne-click seeding of 20 default templates
Multi-Provider SupportSMTP, SendGrid, Mailchimp with admin-selectable provider
Unsubscribe ComplianceRFC 8058, GDPR, CAN-SPAM compliant unsubscribe system
Email Classes4 email classes with appropriate unsubscribe and compliance behavior

Out of Scope

  • A/B testing of page templates (not implemented)
  • Drag-and-drop email editor (HTML-based editing only)
  • Real-time collaborative editing (single editor at a time)
  • Template marketplace or third-party template import
ModuleRelationship
Content ManagementTemplates display content from Strapi CMS
Reader PortalRenders published page templates
Admin Settings & RBACControls permissions for template management
Notifications & EmailUses email templates for all outbound emails
Marketing & OutreachUses email campaign system
User & SubscriptionSubscription lifecycle emails use templates

3. Roles Involved

Page Template System

RoleCapabilities
Super AdminFull access to all template operations
AdminCreate, edit, publish, delete templates; manage categories, static pages, navigation, appearance
EditorView templates; limited to editing page configurations assigned to their scope
ViewerRead-only access to template gallery

Email Template System

RoleCapabilities
Super AdminFull access to all email settings
Admin (with SETTINGS_UPDATE)Create, edit, delete email templates; manage preferences; send test emails; view logs
Admin (with SETTINGS_READ)View email templates, preferences, SMTP status, logs
Marketing (with campaign permissions)Create and send email campaigns

RBAC Permissions Required

Permission KeyControls
homepage:updateTemplate CRUD, page category management
homepage:readView templates and page configurations
SETTINGS_READView email templates, preferences, SMTP status
SETTINGS_UPDATEEdit email templates, preferences; send test emails; seed templates
NAVIGATION_READView navigation and appearance settings (also used by Reader Portal internal token)

4. Architecture & Design Overview

System Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                         ADMIN CONSOLE                               │
│                                                                     │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────────┐  │
│  │ Template      │  │ Email        │  │ Settings                 │  │
│  │ Canvas Editor │  │ Template     │  │ (Navigation, Appearance, │  │
│  │ + Gallery     │  │ Editor       │  │  Features, Paywall)      │  │
│  └──────┬───────┘  └──────┬───────┘  └──────────┬───────────────┘  │
│         │                  │                      │                  │
│  ┌──────▼──────────────────▼──────────────────────▼───────────────┐ │
│  │                    API Layer                                    │ │
│  │  /api/templates  /api/settings/email-templates  /api/settings  │ │
│  └──────┬──────────────────┬──────────────────────┬───────────────┘ │
│         │                  │                      │                  │
│  ┌──────▼──────┐   ┌──────▼──────┐   ┌──────────▼───────────────┐ │
│  │ PostgreSQL  │   │ PostgreSQL  │   │ Strapi CMS               │ │
│  │ (Prisma)    │   │ (Prisma)    │   │ (page-configuration,     │ │
│  │ PageTemplate│   │ EmailTemplate│  │  site-navigation,        │ │
│  │ PageCategory│   │ EmailLog    │   │  site-appearance,        │ │
│  │ TemplateVer │   │ EmailPrefs  │   │  page-template)          │ │
│  └──────┬──────┘   └─────────────┘   └──────────┬───────────────┘ │
│         │                                        │                  │
└─────────┼────────────────────────────────────────┼──────────────────┘
          │                                        │
          │          ┌─────────────────────┐       │
          └──────────▶   Strapi CMS        ◄──────┘
                     │   (Published Data)  │
                     └──────────┬──────────┘

                     ┌──────────▼──────────┐
                     │   READER PORTAL     │
                     │                     │
                     │  TemplateRenderer   │
                     │  DynamicTemplate    │
                     │  176 Section Comps  │
                     │  32 Template Files  │
                     │  ThemeProvider      │
                     └─────────────────────┘

Data Flow — Page Templates

  1. Admin creates/edits template in Canvas Editor
  2. API saves to PostgreSQL (PageTemplate + TemplateVersion) and writes versioned JSON file to /data/templates/
  3. Admin publishes template → API syncs to Strapi CMS (page-configuration content type)
  4. Reader Portal fetches page configuration from Strapi → resolves template → renders sections dynamically
  5. Revalidation webhook triggers ISR cache refresh on Reader Portal

Data Flow — Email Templates

  1. Admin creates/edits email template in Editor
  2. API saves to PostgreSQL (EmailTemplate model)
  3. System event triggers email (subscription welcome, OTP, campaign send, etc.)
  4. Email Pipeline resolves template from DB → replaces variables → wraps with branding → sends via SMTP/provider → logs to EmailLog
  5. Admin views delivery status in Email Logs page

Key Entities & Models

Page Template Models (PostgreSQL/Prisma)

ModelPurpose
PageCategory21 page categories (homepage, article, section, author, etc.)
PageTemplateTemplate definitions with metadata, sections, styles
TemplateVersionVersion history per template (major.minor)
BannerPromotional banners with scheduling
StaticPageStatic content pages (About, Terms, Privacy, etc.)

Strapi Content Types

Content TypeKindPurpose
page-configurationCollectionPer-page-type template configuration (supports draft/publish)
page-templateCollectionTemplate metadata synced from admin
page-versionCollectionVersion snapshots for rollback
site-navigationSingleHeader links, footer columns, social links
site-appearanceSingleGlobal theme (colors, fonts, spacing)
homepageSingleHomepage template selection and hero config
static-pageCollectionStatic page content

Email Models (PostgreSQL/Prisma)

ModelPurpose
EmailTemplateTemplate definitions with key, subject, HTML/text content, variables
EmailLogDelivery log with status tracking, provider, error details
EmailPreferencesSingleton — branding, footer, unsubscribe, CRM settings
EmailCampaignCampaign definitions with segment, status, metrics

Settings Precedence Model

The template system follows a 5-level precedence hierarchy:

Level 1: Global platform settings (DB)     — AUTHORITATIVE, NEVER overrideable
Level 2: Global site defaults (Strapi)     — AUTHORITATIVE with selective override
Level 3: Page template defaults            — OVERRIDE spacing/layout only
Level 4: Page-specific configuration       — Per-page overrides
Level 5: Content access rules              — OVERRIDE paywall per content

5. Prerequisites & Setup Requirements

Appearance settings
Global appearance and theme settings control fonts, colors, and branding across all templates.

Infrastructure Prerequisites

RequirementDetails
Node.js18.x minimum (20.x LTS recommended)
PostgreSQL15.x+ with uuid-ossp and pgcrypto extensions
Redis7.x for caching
Strapi CMSRunning on port 1337 with admin access
Docker / Docker Compose24.x / 2.20+

Environment Variables Required

Admin Console

VariablePurposeExample
DATABASE_URLPostgreSQL connectionpostgresql://hyphen:...@localhost:5432/hyphen_admin
STRAPI_URLStrapi CMS URLhttp://localhost:1337
STRAPI_API_TOKENStrapi API token(from Strapi admin)
NEXT_PUBLIC_READER_PORTAL_URLReader portal URL (for revalidation)http://localhost:3001
READER_PORTAL_REVALIDATION_SECRETShared secret for ISR revalidation(random string)
INTERNAL_API_TOKENShared secret for Reader Portal ↔ Admin API(random string)
EMAIL_ENABLEDEnable email sendingtrue
EMAIL_FROMDefault sender addressnotifications@hyphen.co
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSSMTP configuration(provider-specific)
SENDGRID_API_KEYSendGrid API key (if using SendGrid)SG.xxxxx
VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEYPush notification keys(from npx web-push generate-vapid-keys)

Reader Portal

VariablePurposeExample
NEXT_PUBLIC_STRAPI_URLStrapi CMS URLhttp://localhost:1337
STRAPI_API_TOKENStrapi API token(from Strapi admin)
NEXT_PUBLIC_ADMIN_API_URLAdmin console API URLhttp://localhost:3000
INTERNAL_API_TOKENSame value as Admin Console(matching secret)
REVALIDATION_SECRETSame as READER_PORTAL_REVALIDATION_SECRET(matching secret)
NEXT_PUBLIC_SITE_NAMESite display nameHyphen

Module Dependencies (Must Be Set Up First)

DependencyRequired For
Core Infrastructure (Docker, PostgreSQL, Redis)Database and caching
Strapi CMS with content types createdTemplate sync, page configurations
Authentication & User ManagementAdmin login, RBAC
Prisma migrations run (npx prisma migrate deploy)PageTemplate, EmailTemplate models

Seed Data Initialization

Before the template system is usable, seed data must be initialized:

  1. Page Categories — Seed 21 built-in categories:

    POST /api/page-categories/seed
  2. Page Templates — Seed built-in templates:

    POST /api/templates/seed
  3. Email Templates — Seed default email templates (subscription, campaign, notification, OTP, and operational):

    POST /api/settings/email-templates/seed

    Or click the "Seed Missing" button in Settings > Email Templates.

Strapi Content Types Required

The following content types must exist in Strapi:

  • page-configuration (collection, draft & publish enabled)
  • page-template (collection)
  • page-version (collection)
  • site-navigation (single type)
  • site-appearance (single type)
  • homepage (single type)
  • static-page (collection)

6. Configuration Guide — Page Template System

Page Configuration
The Page Configuration screen lists all page types organized by category. Click any page to select or create a template for it.

6.1 Accessing the Template System

Navigate to Layout & Design in the admin console sidebar:

Menu ItemPathPurpose
Pages/layout/pagesView and manage page types with their templates
Templates/layout/templatesBrowse the full template gallery
Categories/layout/categoriesManage page categories
Static Pages/layout/static-pagesManage static content pages
Campaigns/layout/campaignsCampaign landing page layouts
Homepage/homepageHomepage-specific editor
Navigation/navigation or /settings/navigationHeader/footer link management
Appearance/settings/appearanceTheme customization

6.2 Understanding Page Categories

There are 21 built-in page categories:

CategorySlugDescription
HomepagehomepageMain landing page
ArticlearticleIndividual article pages
SectionsectionSection/category listing pages (Fiction, Poetry, Essays, etc.)
IndexindexIndex/directory pages
AuthorauthorAuthor profile pages
SubscriptionsubscriptionSubscription/pricing pages
SearchsearchSearch results page
StaticstaticStatic content pages
CampaigncampaignCampaign landing pages
TagtagTag listing pages
ArchivearchiveArchive/back-issue pages
Magazine Issuesmagazine-issuesMagazine issue viewer
ShopshopE-commerce pages
EventeventEvent pages
PodcastpodcastPodcast pages
CollectioncollectionCurated collection pages
InstitutionalinstitutionalInstitutional subscription pages
AccountaccountReader account pages
Newsletter Archivenewsletter-archiveNewsletter archive pages
GiftgiftGift subscription pages
ErrorerrorError pages (404, 500)

6.3 Working with the Template Canvas Editor

Opening the Editor

  1. Go to Layout & Design > Pages
  2. Select a page type (e.g., Homepage)
  3. Click on the assigned template or click Edit Template
  4. The Canvas Editor opens with three panels:
    • Left Panel: Section Palette (drag sections from here)
    • Center Panel: Canvas Area (your page layout)
    • Right Panel: Properties Panel (configure selected section)

Adding Sections

  1. In the Section Palette (left panel), browse section variants by category
  2. Drag a section variant onto the Canvas Area
  3. Drop it in the desired position (drop zones appear between existing sections)
  4. The section appears on the canvas with default configuration

Configuring Section Properties

When you select a section on the canvas, the Properties Panel shows configuration options based on the section's behavior type:

Behavior TypeProperties Available
ListingContent source (dynamic/manual/mixed), category filter, tag filter, max items, sort order, entity picker
DetailEntity reference, display fields, related content config
ContextualRelationship type, related entity config
StaticTitle, subtitle, body text, CTA button, image

Section Variant Categories

CategoryExamplesCount
HeroHeroFullWidth, HeroImageLeft, HeroImageRight, HeroMinimal, HeroCarousel5
Article GridsGrid2Column, Grid3Column, Grid2WithSidebar, Grid4Carousel4
FeaturedFeaturedLeftGridRight, FeaturedAboveGrid, FeaturedMixed3
Article ListsListHorizontalCards, ListVerticalCards, ListMinimal3
Article DetailArticleHeader, ArticleContent, ArticlePaywallGate, etc.10
CampaignCampaignHero, CampaignForm, CampaignCountdown, etc.11
EventEventHero, EventListingCards, EventRsvpForm, etc.7
PodcastPodcastShowHeader, PodcastEpisodeList, PodcastMiniPlayer6
ShopShopHero, ShopProductGrid, ShopProductHeader9
ArchiveArchiveHero, ArchiveIssueGrid, ArchiveTimelineView7
NewsletterNewsletterArchiveHeader, NewsletterEditionGrid4
And 10+ more categoriesSidebar, footer, account, institutional, error, etc.100+

Reordering Sections

  • Drag sections up or down on the canvas to reorder
  • Section order property updates automatically

Removing Sections

  • Select the section on the canvas
  • Click the Delete/Remove button in the Canvas Toolbar or section context menu

Live Preview

  • The LiveTemplatePreview component renders a real-time preview of the current template configuration
  • Preview updates as you modify section properties

6.4 Template Versioning

Every template edit creates a version record:

FieldDescription
Major versionIncremented for breaking changes (component removal, layout redesign)
Minor versionIncremented for non-breaking changes (section reorder, config update)
Change noteOptional description of what changed
Created byAdmin user who made the change

Viewing Version History:

  1. Open a template in the editor
  2. Click Version History to see all versions
  3. Each version shows: version number, change note, author, timestamp

Rolling Back:

  1. In the version history, find the desired version
  2. Click Rollback to this version
  3. A new version is created with the rolled-back content (non-destructive)

6.5 Publishing Templates

Publishing syncs the template configuration to Strapi CMS, making it available to the Reader Portal.

  1. Open the template in the editor
  2. Review the configuration
  3. Click Publish
  4. The API:
    • Sets template status to active
    • Syncs template data to Strapi page-configuration content type
    • Triggers Reader Portal ISR revalidation
  5. Changes appear on the Reader Portal within seconds

6.6 Managing Static Pages

  1. Go to Layout & Design > Static Pages
  2. Click Create to add a new page (or select existing)
  3. Fill in:
    • Title — Page heading
    • Slug — URL path (e.g., about, privacy-policy, terms)
    • Category — Default: static
    • Template ID — Optionally bind to a template
    • Content — Rich text content
    • Active — Toggle visibility
  4. Click Save

6.7 Managing Navigation

Navigate to Settings > Navigation or Navigation page.

  • Add, edit, reorder, or remove main navigation links
  • Each link has: label, URL, and optional icon
  • Changes sync to Strapi site-navigation single type
  • Configure footer columns (each with title and list of links)
  • Add social media links (X/Twitter, Facebook, Instagram, LinkedIn, etc.)
  • Set copyright text and company information

6.8 Theme & Appearance

Navigate to Settings > Appearance.

Available customizations:

SettingDescription
Color ThemePrimary, secondary, accent, background colors
TypographyFont family, heading sizes, body text sizes
SpacingContainer width, section spacing, content padding
Header StylesHeader background, text color, logo placement
Footer StylesFooter background, text color, layout

Changes sync to Strapi site-appearance and are consumed by the Reader Portal's ThemeProvider which applies them as CSS variables and Tailwind classes.

Live Preview: The appearance editor includes a live preview panel showing how changes will look on the Reader Portal.


7. Configuration Guide — Email Template System

Email templates
Manage email templates for notifications, campaigns, and transactional emails.

7.1 Accessing Email Templates

Navigate to the Layout & Design sidebar group (previously under Settings):

Menu ItemPathPurpose
Email Templates/settings/emailsBrowse and manage all email templates
Email Configuration/settings/emails/configSMTP/provider settings
Email Preferences/settings/emails/preferencesBranding, footer, unsubscribe settings
Email Logs/settings/emails/logsDelivery log viewer

7.2 Initial Setup — Seed Default Templates

Before email templates are usable, seed the defaults:

  1. Go to Settings > Email Templates
  2. Click the "Seed Missing" button in the header
  3. This creates 20 default templates (only creates missing ones, never overwrites existing):
CategoryTemplates
Subscription (7)Welcome, Renewal Reminder, Expiration, Payment Receipt, Future Readers Coupon, Institutional Invite, Gift Activation
Campaign (4)Submission Approved, Submission Rejected, Invitation, New Campaign Notification
Notification (8)New Submission, Reassigned, Action Needed, Author Response, Ready for Review, Publishing Approved, Change Requested, Article Live
System (1)OTP Verification

7.3 Creating / Editing Email Templates

  1. Go to Settings > Email Templates
  2. Click Create New or select an existing template
  3. Fill in:
FieldDescriptionRequired
KeyUnique identifier (e.g., subscription_welcome)Yes (immutable after creation)
NameDisplay name (e.g., "Welcome Email")Yes
SubjectEmail subject line — supports {{variables}}Yes
HTML ContentHTML email body — supports {{variables}}Yes
Text ContentPlain-text fallback bodyRecommended
VariablesList of variable names used in the templateAuto-detected
ActiveToggle template availabilityYes (default: true)

7.4 Using Template Variables

Variables are placeholders that get replaced with actual values at send time.

Syntax: {{variableName}} Matching: Case-insensitive (e.g., {{userName}} matches username)

System Variables (Auto-Injected)

These are always available in every template:

VariableSourceExample Value
{{site_name}}NEXT_PUBLIC_SITE_NAME env varHyphen
{{site_url}}System settingshttps://hyphen.co
{{support_email}}CRM settingssupport@hyphen.co
{{current_year}}System2026
{{unsubscribe_url}}HMAC-generated per recipienthttps://hyphen.co/unsubscribe?token=...

CRM Variables (Auto-Injected from CRM Settings)

VariableSource
{{support_phone}}CRM settings
{{admin_portal_url}}CRM settings
{{reader_portal_url}}CRM settings
{{user_guide_url}}CRM settings
{{company_website}}CRM settings
{{schedule_demo_url}}CRM settings
{{pricing_page_url}}CRM settings

Context-Specific Variables

Template TypeVariables
Subscription emails{{userName}}, {{userEmail}}, {{subscriptionPlan}}, {{subscriptionEndDate}}, {{renewalLink}}
OTP{{otpCode}}, {{expiryMinutes}}
Article notifications{{articleTitle}}, {{articleAuthor}}, {{articleUrl}}
Campaign{{campaignName}}, {{offerCode}}, {{redemption_instructions}}
Password reset{{resetLink}}, {{userName}}

7.5 Previewing Email Templates

  1. In the template editor, click Preview
  2. The preview renders the template with:
    • Branding wrapper (logo, header, footer from Email Preferences)
    • Sample variable values
    • Actual styling as it would appear in email clients

7.6 Sending Test Emails

  1. In the template editor, click Send Test
  2. Enter a recipient email address
  3. The system sends the email with:
    • [TEST] prefix in subject line
    • Sample variable values
    • Full branding wrapper
  4. Check the Email Logs page to verify delivery

7.7 Configuring Email Branding (Preferences)

Navigate to Settings > Email Templates > Preferences:

SectionSettings
HeaderLogo URL, background color
FooterCompany name, address, social media links, copyright text, custom HTML
UnsubscribeLink text, preferences URL, grace period (0–30 days), confirmation required, reason options
Font & ColorsFont family, primary color
CRMSupport email, portal URLs, company website

Important: Custom footer HTML is sanitized server-side to prevent XSS (strips scripts, iframes, event handlers, javascript: URLs).

7.8 SMTP / Provider Configuration

Navigate to Settings > Email Templates > Config:

  1. Select the email provider: SMTP, SendGrid, or Mailchimp
  2. Enter provider credentials
  3. Click Test Connection to verify
  4. Save configuration

Note: After changing provider configuration, the cached SMTP transporter may need a server restart to take effect (known anti-pattern, see Limitations section).

7.9 Viewing Email Logs

Navigate to Settings > Email Templates > Logs:

ColumnDescription
RecipientEmail address + name
TemplateTemplate key used
SubjectRendered subject line
Statussent, failed, bounced, pending
Providersmtp, sendgrid, etc.
Sent AtTimestamp
ErrorError message if failed

Additional features:

  • Unsubscribe Analytics — Collapsible section showing: total unsubscribes, by reason, by category, 30-day timeline

8. How the Page Template System Works End to End

8.1 Template Lifecycle

Create Template → Edit Sections → Configure Properties → Preview → Publish → Render on Reader Portal

                                                            Version Created
                                                            Sync to Strapi
                                                            Revalidate ISR

8.2 What Happens When You Publish

  1. Template status set to active in PostgreSQL
  2. Template data (sections, styles, banners) synced to Strapi page-configuration
  3. Strapi stores as a published document (draft/publish workflow)
  4. Reader Portal receives revalidation webhook
  5. Next.js ISR regenerates affected pages
  6. Readers see updated layout within seconds

8.3 Reader Portal Rendering Pipeline

1. Request arrives at Reader Portal (e.g., /fiction)
2. Next.js route resolves page type (e.g., "section")
3. Fetch page-configuration from Strapi for this page type
4. Extract templateId, sections[], banners[], styles
5. TemplateRenderer maps templateId → React component
6. DynamicTemplate iterates over sections[]:
   a. Resolve section variant → SectionRenderer → actual component
   b. Fetch section data based on contentSource (dynamic queries, manual IDs, mixed)
   c. Apply personalization boost if personalizationEnabled=true
   d. Render section component with data + properties
7. PageStyleOverrides applies page-level CSS overrides
8. BannerRenderer renders active banners (checks startsAt/endsAt)
9. ThemeProvider applies global appearance (colors, fonts, spacing)

8.4 Section Data Resolution

Each section can get content from different sources:

Content SourceHow It Works
DynamicQueries Strapi with filters (category, tag, date range, sort order, max items)
ManualUses manually selected entity IDs (via EntityPicker)
MixedCombines manual pinned items + dynamic fill
StaticNo data fetch — uses section configuration directly (text, images, CTAs)

9. How the Email Template System Works End to End

9.1 Email Pipeline Flow

1. System event triggers email (e.g., new subscription)
2. Determine email class (mandatory-transactional, transactional-lifecycle, operational, marketing)
3. Resolve template:
   a. Look up EmailTemplate by key in DB
   b. If not found, use hardcoded fallback
4. Replace variables:
   a. Auto-inject system variables (site_name, support_email, etc.)
   b. Auto-inject CRM variables
   c. Replace caller-provided variables
   d. Case-insensitive matching
5. Wrap with branding:
   a. Load EmailPreferences from DB
   b. Apply header (logo, colors)
   c. Apply footer (company info, social links)
   d. Add unsubscribe link (if email class requires it)
   e. Add RFC 8058 List-Unsubscribe headers (if marketing/lifecycle)
6. Generate plain text fallback (strip HTML if textContent not provided)
7. Send via configured provider (SMTP/SendGrid/Mailchimp)
8. Log to EmailLog (template, recipient, status, provider, messageId)

9.2 Email Classes and Compliance

ClassWhen UsedUnsubscribeCan Suppress?
mandatory-transactionalOTP, password reset, payment receiptNoneNever
transactional-lifecycleWelcome, renewal, expiry, gift, institutional inviteReader HMAC linkRespects reader prefs
operationalInstitution inquiry, admin workflow notificationsNoneN/A
marketingCampaigns, newsletters, outreachReader HMAC linkMust respect opt-in

9.3 Unsubscribe Flow

  1. Reader clicks unsubscribe link in email
  2. Link contains HMAC token (generated from email + secret)
  3. Reader Portal /unsubscribe page loads
  4. If requireConfirmation enabled: a. Shows confirmation message b. Optional reason picker (admin-configured options) c. Grace period notice if configured
  5. Reader confirms → API processes unsubscribe: a. Update Reader.newsletterOptIn b. Set AudienceContact.unsubscribedAt c. Create audit log entry d. If grace period > 0: store as pending, process via daily cron
  6. Reader sees confirmation with category-specific message

10. Business Logic & Rules

Page Template Rules

RuleDescription
Seed-on-writeBuilt-in templates are auto-copied to DB on first edit (preserves original)
DB precedenceDB templates override built-in templates by slug
Version always createdEvery edit creates a TemplateVersion record
One active per page typeOnly one published template can be active per page type at a time
Built-in protectionBuilt-in templates cannot be deleted (only archived)
Strapi sync on publishPublishing always syncs to Strapi (not saved to Strapi on draft)
ISR revalidationPublishing triggers Reader Portal cache invalidation
Section visibilitySections with isVisible: false are skipped during rendering
Banner schedulingBanners respect startsAt and endsAt — only active banners render
Personalization per-sectionSections with personalizationEnabled: true boost content matching reader preferences

Email Template Rules

RuleDescription
DB-first resolutionTemplates resolved from DB by key; hardcoded fallback if not found
Case-insensitive variables{{userName}} and {{username}} both match
System variables auto-injectedsite_name, support_email, current_year always available
Caller overrides systemCaller-provided variables take precedence over system variables
Branding always appliedAll emails wrapped with branding from EmailPreferences
Unsubscribe by classMarketing and lifecycle emails include unsubscribe; transactional do not
AudienceContact suppressionUnsubscribed contacts excluded from all audience queries
Grace period enforcementIf configured, unsubscribes are deferred and processed by daily cron
EmailLog always createdEvery email send (success or failure) creates an EmailLog entry
Test emails markedTest sends have [TEST] subject prefix
Seed is additiveTemplate seeding only creates missing templates (by key), never overwrites

Style Precedence

Global Appearance (Strapi) → Template defaultStyles → Page-specific styles

Override scope:

  • spacing, containerWidth, fontFamily can be overridden at template and page level
  • Colors, global fonts, and navigation are authoritative from global settings

11. Use Cases & Operational Scenarios

Page Template Use Cases

#ScenarioSteps
1Change homepage layoutOpen Homepage editor → Select different template → Rearrange sections → Publish
2Add a featured section to category pageGo to Pages → Select Section page → Edit template → Drag "FeaturedAboveGrid" section → Configure content source → Publish
3Create campaign landing pageGo to Layout > Campaigns → Create new → Select campaign template → Add hero, form, countdown sections → Configure → Publish
4Customize article pageGo to Pages → Select Article → Edit template → Add/remove sections (header, content, comments, related, paywall gate) → Publish
5Create static About pageGo to Static Pages → Create → Set title, slug, content → Activate
6Revert a template changeOpen template → Version History → Select previous version → Rollback
7Add promotional bannerHomepage editor → Banner section → Create banner with image, link, schedule → Save
8Change site themeSettings > Appearance → Modify colors, fonts, spacing → Preview → Save
9Update navigationSettings > Navigation → Edit header links → Edit footer columns → Save
10Preview before publishTemplate editor → Preview mode → Verify layout → Close preview → Publish

Email Template Use Cases

#ScenarioSteps
1Customize welcome emailEmail Templates → Find subscription_welcome → Edit subject/body → Preview → Test send → Save
2Change email brandingEmail Templates > Preferences → Update logo, colors, footer → Save
3Add new notification templateEmail Templates → Create New → Set key, name, subject, body, variables → Save
4Verify email deliveryEmail Logs → Filter by status/date → Inspect failed emails → Check error messages
5Configure SMTPEmail Config → Select provider → Enter credentials → Test connection → Save
6Send email campaignMarketing > Email Campaigns → Create → Select template → Choose audience → Preview → Send
7Review unsubscribe trendsEmail Logs → Expand Unsubscribe Analytics → Review by reason, category, timeline
8Seed missing templatesEmail Templates → Click "Seed Missing" → Verify 20 templates created

12. End-to-End User Flows

Flow 1: Create and Publish a New Page Template

Step 1: Admin navigates to Layout & Design > Pages
Step 2: Selects a page type (e.g., "Section")
Step 3: Clicks "Edit Template" or creates a new template
Step 4: Canvas Editor opens with three panels
Step 5: Admin drags sections from the palette onto the canvas:
        - HeroFullWidth (hero section)
        - FeaturedAboveGrid (featured articles)
        - Grid3Column (article grid)
        - NewsletterInline (newsletter signup)
Step 6: For each section, admin configures properties:
        - Content source: dynamic
        - Category filter: current section's category
        - Max items: 9
        - Sort order: newest first
Step 7: Admin clicks "Preview" to verify layout
Step 8: Admin clicks "Publish"
Step 9: System syncs to Strapi + triggers revalidation
Step 10: Reader Portal shows updated section page layout

Flow 2: Customize and Test an Email Template

Step 1: Admin navigates to Settings > Email Templates
Step 2: Locates "Subscription Welcome" template
Step 3: Opens the editor
Step 4: Modifies subject line: "Welcome to `{{site_name}}`, `{{userName}}`!"
Step 5: Edits HTML body with updated welcome message
Step 6: Clicks "Preview" — sees rendered email with branding
Step 7: Clicks "Send Test" → enters own email address
Step 8: Receives test email with [TEST] prefix
Step 9: Verifies styling, variables, branding in email client
Step 10: Clicks "Save" to persist changes
Step 11: Future welcome emails use the updated template

Flow 3: Configure Email Branding

Step 1: Admin navigates to Settings > Email Templates > Preferences
Step 2: Updates Header section:
        - Upload logo image URL
        - Set header background color
Step 3: Updates Footer section:
        - Company name, address
        - Social media links (Twitter, Facebook, etc.)
        - Copyright text
Step 4: Updates Unsubscribe section:
        - Grace period: 7 days
        - Require confirmation: Yes
        - Reason options: "Too many emails", "Not relevant", "Other"
Step 5: Clicks "Save"
Step 6: All future emails use updated branding

Flow 4: Manage Site Appearance and Navigation

Step 1: Admin navigates to Settings > Appearance
Step 2: Adjusts color theme (primary color, accent color)
Step 3: Selects font family for headings and body
Step 4: Adjusts spacing (container width, section padding)
Step 5: Previews changes in live preview panel
Step 6: Clicks "Save" → Strapi updated → Reader Portal revalidated

Step 7: Admin navigates to Settings > Navigation
Step 8: Adds "Programs" link to header navigation
Step 9: Reorders footer columns
Step 10: Adds Instagram social link
Step 11: Clicks "Save" → Changes appear on Reader Portal

Internal — QA, Testing & Limitations
13. QA Scenarios & Test Matrix
13.1 Page Template System — Test Scenarios
Setup Validation
#ScenarioPreconditionStepsExpected Result
T-PT-001Seed page categoriesEmpty DBPOST /api/page-categories/seed21 categories created
T-PT-002Seed page templatesCategories seededPOST /api/templates/seed80+ templates created
T-PT-003Verify Strapi content typesStrapi runningCheck Strapi admin for required content typesAll 7 content types present
T-PT-004Verify env variablesFresh deploymentCheck STRAPI_URL, STRAPI_API_TOKEN, INTERNAL_API_TOKENAll set and valid
Template CRUD (Happy Path)
#ScenarioStepsExpected Result
T-PT-010List templatesGET /api/templatesReturns all templates (DB + built-in)
T-PT-011Filter by categoryGET /api/templates?category=homepageOnly homepage templates returned
T-PT-012Create custom templatePOST /api/templates with name, sectionsTemplate created with draft status
T-PT-013Edit templatePUT /api/templates with updated sectionsTemplate updated, minor version incremented
T-PT-014Delete custom templateDELETE /api/templates?id=xxxTemplate deleted
T-PT-015Cannot delete built-inDELETE /api/templates?id=editorial-classicError: cannot delete built-in template
Template Versioning
#ScenarioStepsExpected Result
T-PT-020Version created on editEdit template → SaveNew TemplateVersion record created
T-PT-021View version historyGET /api/templates/[id]/versionsList of all versions with change notes
T-PT-022Rollback to previousSelect old version → RollbackNew version created with old content
T-PT-023Seed-on-write for built-inEdit a built-in templateTemplate copied to DB, then edited
Template Publishing
#ScenarioStepsExpected Result
T-PT-030Publish templatePOST /api/templates/[id]/publishStatus=active, synced to Strapi
T-PT-031Verify Strapi syncPublish → Check Strapi adminpage-configuration document updated
T-PT-032Verify revalidationPublish → Check Reader PortalUpdated layout visible
T-PT-033Publish requires permissionUser without homepage:update403 Forbidden
Canvas Editor UI
#ScenarioStepsExpected Result
T-PT-040Drag-drop sectionDrag hero section to canvasSection added at drop position
T-PT-041Configure section propertiesSelect section → Change content sourceProperties saved
T-PT-042Reorder sectionsDrag section to new positionOrder updated
T-PT-043Remove sectionSelect → DeleteSection removed from canvas
T-PT-044Live previewEdit sections → Check previewPreview reflects changes in real-time
T-PT-045Section palette filteringSelect page categoryOnly compatible sections shown
Reader Portal Rendering
#ScenarioStepsExpected Result
T-PT-050Homepage renders with templatePublish homepage template → Visit reader portal /Sections render as configured
T-PT-051Section page rendersPublish section template → Visit /fictionSection page shows template layout
T-PT-052Article page rendersPublish article template → Visit /article/[slug]Article page shows template layout
T-PT-053Dynamic content loadsSection with dynamic source → Check readerArticles fetched from Strapi and displayed
T-PT-054Manual content loadsSection with manual IDs → Check readerSpecific articles displayed in order
T-PT-055Banner schedulingCreate banner with future startsAtBanner not visible before start time
T-PT-056Banner scheduling (active)Create banner with past startsAt, future endsAtBanner visible
T-PT-057Theme appliedModify appearance settings → Check readerCSS variables updated, styling changes
T-PT-058Navigation dynamicUpdate nav in admin → Check reader header/footerLinks updated
T-PT-059Static page rendersCreate static page → Visit /[slug] on readerPage content displayed
T-PT-060Personalized sectionSection with personalizationEnabled → Logged-in reader with prefsContent boosted by preferences
Page Categories
#ScenarioStepsExpected Result
T-PT-070List categoriesGET /api/page-categories21 categories returned
T-PT-071Get category templatesGET /api/page-categories/[slug]Category with associated templates
T-PT-072Category CRUDCreate/edit/delete custom categoryCategory managed
Static Pages
#ScenarioStepsExpected Result
T-PT-080Create static pagePOST with title, slug, contentPage created
T-PT-081Edit static pagePUT with updated contentPage updated
T-PT-082Delete static pageDELETE by slugPage removed
T-PT-083Unique slug validationCreate page with existing slugError: slug already exists
T-PT-084Active toggleSet isActive=falsePage not rendered on reader portal
13.2 Email Template System — Test Scenarios
Setup Validation
#ScenarioPreconditionStepsExpected Result
T-ET-001Seed email templatesEmpty DBPOST /api/settings/email-templates/seed20 templates created
T-ET-002Seed is idempotentTemplates existRun seed againNo duplicates; existing templates unchanged
T-ET-003SMTP configuredSMTP credentials setCheck SMTP status endpointConnection successful
T-ET-004Verify EMAIL_ENABLEDEnv var setCheck system settingsEmail sending enabled
Email Template CRUD
#ScenarioStepsExpected Result
T-ET-010List templatesGET /api/settings/email-templatesAll templates returned with categories
T-ET-011Create templatePOST with key, name, subject, htmlContentTemplate created
T-ET-012Edit templatePUT with updated subject/bodyTemplate updated
T-ET-013Delete templateDELETE by IDTemplate removed
T-ET-014Unique key validationCreate with existing keyError: key already exists
T-ET-015Requires SETTINGS_UPDATEUser without permission403 Forbidden
Variable Replacement
#ScenarioStepsExpected Result
T-ET-020Basic variableTemplate with {{userName}} → send with userName="John""John" in rendered email
T-ET-021Case-insensitiveTemplate with {{UserName}} → send with username="Jane""Jane" in rendered email
T-ET-022System variablesTemplate with {{site_name}} → sendSite name appears
T-ET-023CRM variablesTemplate with {{support_email}} → sendCRM support email appears
T-ET-024Missing variableTemplate with {{unknown}} → send{{unknown}} left as-is or empty
T-ET-025Caller overrides systemSend with site_name="Custom""Custom" used instead of system value
Email Preview & Test Send
#ScenarioStepsExpected Result
T-ET-030Preview templateClick Preview in editorRendered HTML with branding wrapper shown
T-ET-031Send test emailClick Send Test → enter emailEmail received with [TEST] prefix
T-ET-032Test email loggedSend test → check Email LogsEmailLog entry created
Email Branding & Preferences
#ScenarioStepsExpected Result
T-ET-040Update brandingChange logo, colors → SaveFuture emails use new branding
T-ET-041Update footerChange company name, social links → SaveFooter updated in all emails
T-ET-042Custom footer HTML sanitizedEnter <script>alert('xss')</script>Script tag stripped
T-ET-043Unsubscribe settingsSet grace period, require confirmationUnsubscribe flow respects settings
Email Delivery & Logging
#ScenarioStepsExpected Result
T-ET-050Successful deliveryTrigger subscription welcome emailEmailLog: status=sent, provider set
T-ET-051Failed deliverySend to invalid SMTP configEmailLog: status=failed, errorMessage set
T-ET-052OTP email loggedTrigger OTP emailEmailLog entry with template_key=otp_verification
T-ET-053Subscription emails loggedTrigger renewal reminderEmailLog entry with correct template key
T-ET-054View email logsNavigate to Email Logs pageList of all sent emails with filters
Email Compliance
#ScenarioStepsExpected Result
T-ET-060Marketing email has unsubscribeSend marketing emailUnsubscribe link in footer + List-Unsubscribe header
T-ET-061Transactional no unsubscribeSend OTP emailNo unsubscribe link
T-ET-062Lifecycle has unsubscribeSend welcome emailUnsubscribe link present
T-ET-063HMAC unsubscribe token validClick unsubscribe linkToken validates, unsubscribe processes
T-ET-064Unsubscribed contact suppressedUnsubscribe reader → Send campaignUnsubscribed contact not in audience
T-ET-065Grace period enforcedSet 7-day grace → UnsubscribePending unsubscribe stored, processed after 7 days
T-ET-066Confirmation requiredEnable confirmation → UnsubscribeConfirmation page shown before processing
T-ET-067Reason capturedEnable reasons → Unsubscribe with reasonReason stored in audit log
T-ET-068CAN-SPAM addressCheck marketing emailPhysical address in footer (from EmailPreferences)
Email Campaigns
#ScenarioStepsExpected Result
T-ET-070Create campaignMarketing > Email Campaigns → CreateCampaign created
T-ET-071Preview campaignSelect template → PreviewRendered campaign email shown
T-ET-072Send campaignConfigure audience → SendEmails sent to audience segment
T-ET-073Campaign loggedSend campaignEmailLog entries for each recipient
T-ET-074Unsubscribed excludedAudience with unsubscribed contactsUnsubscribed contacts not included
T-ET-075Duplicate campaignClick DuplicateNew campaign created with same settings
13.3 Cross-Module Integration Tests
#ScenarioModules InvolvedStepsExpected Result
T-XM-001Template → Strapi → ReaderTemplates, Strapi, Reader PortalPublish template → Verify Strapi → Verify ReaderFull pipeline works
T-XM-002Settings → Reader PortalSettings, Reader PortalChange appearance → Check readerTheme updates
T-XM-003Email template → SubscriptionEmail, SubscriptionNew subscriber → Welcome emailEmail uses DB template with branding
T-XM-004Feature flag → Section renderingSettings, Reader PortalDisable newsletter_popup flag → Check readerNewsletter section hidden
T-XM-005Navigation → Reader Header/FooterNavigation, Reader PortalUpdate nav links → Check readerLinks updated
T-XM-006Campaign → Email → UnsubscribeMarketing, Email, Reader PortalSend campaign → Click unsubscribe → VerifyFull unsubscribe flow works
T-XM-007Internal token authAdmin Console, Reader PortalReader Portal fetches settings via internal tokenSettings returned correctly
T-XM-008Paywall + templateTemplates, PaywallArticle template with paywall gate → Non-subscriberPaywall overlay shown
13.4 Permission / RBAC Tests
#ScenarioStepsExpected Result
T-RBAC-001Template edit without permissionUser without homepage:update → Edit template403 Forbidden
T-RBAC-002Email template edit without permissionUser without SETTINGS_UPDATE → Edit email template403 Forbidden
T-RBAC-003Template read without authUnauthenticated → GET /api/templatesTemplates returned (public read)
T-RBAC-004Email template read requires authUnauthenticated → GET /api/settings/email-templates401 Unauthorized
T-RBAC-005Internal token for reader portalReader Portal with valid INTERNAL_API_TOKENSettings returned
T-RBAC-006Invalid internal tokenReader Portal with wrong token401 Unauthorized
13.5 Edge Cases & Negative Tests
#ScenarioStepsExpected Result
T-EDGE-001Publish with Strapi downStrapi offline → Publish templateError message; template not marked active
T-EDGE-002Empty template sectionsCreate template with no sections → PublishValid but renders empty page
T-EDGE-003Invalid section variantTemplate with non-existent variantGraceful fallback (section skipped)
T-EDGE-004Circular content sourceSection referencing itselfNo infinite loop; empty or error
T-EDGE-005Email send with no SMTPEMAIL_ENABLED=false → Trigger emailEmail not sent; logged appropriately
T-EDGE-006Very long email bodyTemplate with 100KB+ HTMLEmail sends successfully
T-EDGE-007Special characters in variablesVariable value with <script> tagHTML escaped in output
T-EDGE-008Concurrent template editsTwo admins edit same templateLast save wins; both create versions
T-EDGE-009Missing Strapi contentReader Portal with empty StrapiGraceful fallback (default layout or error page)
T-EDGE-010Template with hidden sectionsAll sections isVisible=falseEmpty page body renders

14. Troubleshooting & Common Issues
Page Template Issues
SymptomPossible CauseResolution
Template changes not visible on Reader PortalRevalidation not triggeredRe-publish template; verify READER_PORTAL_REVALIDATION_SECRET matches
"Cannot sync to Strapi" errorStrapi down or token invalidVerify Strapi is running; check STRAPI_URL and STRAPI_API_TOKEN
Empty page on Reader PortalNo page-configuration in Strapi for this page typePublish the template for this page type
Section shows "No content"Content source misconfigured or Strapi emptyCheck section properties; verify content exists in Strapi
Theme changes not reflectedBrowser cacheHard refresh (Ctrl+Shift+R); verify Strapi site-appearance updated
Template gallery emptySeed not runRun POST /api/templates/seed and POST /api/page-categories/seed
Version history emptyTemplate never edited (built-in)First edit creates initial DB record and version
Drag-drop not workingBrowser compatibilityUse Chrome/Edge; clear cache
Email Template Issues
SymptomPossible CauseResolution
Emails not sendingEMAIL_ENABLED=false or SMTP misconfiguredCheck env var; test SMTP connection in Email Config page
Email styling brokenCustom footer HTML has invalid markupCheck Preferences > Footer; simplify HTML
Variables not replacedWrong variable name or missing from callerCheck template variables[] list; verify caller passes values
Test email not receivedSpam filter or invalid emailCheck spam folder; verify recipient address; check Email Logs
"No email template found" in logsTemplate key mismatchVerify template key matches the expected key; run seed
Unsubscribe link not workingREADER_JWT_SECRET not setSet env var for HMAC token generation
Branding not appliedEmailPreferences record missingNavigate to Preferences page and save (creates default record)
Provider change not taking effectCached SMTP transporterRestart admin console server
Campaign sends to wrong audienceSegment filter incorrectReview segment query; verify unsubscribedAt: null filter
Email logs show "failed"SMTP credentials expired or quota exceededCheck error message; verify provider credentials

15. Known Limitations & Current Gaps
Page Template System
ItemDescriptionSeverityWorkaround
No A/B testingCannot test multiple template variants against each otherLowManually switch templates and compare analytics
Single editor at a timeNo collaborative editing or lockingMediumCoordinate edits via team communication
ContentTypeBadge duplicationShared component not yet extracted for all sectionsLowNon-blocking; cosmetic code cleanup
Inline SVG icon duplicationSame SVG icons duplicated across 50+ section filesLowNon-blocking; candidate for shared icon utility
No template import/exportCannot transfer templates between environmentsMediumManual database migration
Email Template System
ItemDescriptionSeverityWorkaround
Email config cache without invalidationProvider config changes may require server restartMediumRestart admin console after changing SMTP config
No email rate limitingBulk sends process sequentially without throttlingMediumFor large subscriber bases, monitor delivery rates
No drag-drop email editorEmail editing is HTML-based, not visual drag-dropLowUse external HTML email builder, paste HTML
VAPID keys must be generated manuallyPush notification keys not auto-generatedLowRun npx web-push generate-vapid-keys during setup
Self-hosted social icons pendingEmail footer social icons from external CDN (img.icons8.com)LowReplace with self-hosted assets in production
Institution inquiry templates hardcodedCRM email drafts in route file, not in DBLowIntentional design — used as pre-written drafts for sales staff
Integration deep wiring partialSome integration settings not fully connected to SDK initializationMediumConfigure directly via env vars
Follow-Up Recommendations
  1. Email config hot-reload — Call resetTransporter() from the email config update API to avoid restart requirement
  2. Email rate limiting — Add queue system (e.g., Bull/BullMQ) for large-scale campaign sends
  3. Template import/export — Add JSON export/import endpoints for template portability
  4. Collaborative editing — Add optimistic locking or WebSocket-based real-time collaboration
  5. Self-host social icons — Replace img.icons8.com CDN with /public/icons/ assets

16. Appendix
A. Page/API Reference
Page Template APIs
MethodEndpointPermissionPurpose
GET/api/templatesNone (public)List/filter templates
POST/api/templateshomepage:updateCreate template
PUT/api/templateshomepage:updateUpdate template
DELETE/api/templateshomepage:updateDelete template
GET/api/templates/[id]/versionshomepage:readVersion history
POST/api/templates/[id]/publishhomepage:updatePublish template
POST/api/templates/seedhomepage:updateSeed built-in templates
GET/api/page-categoriesNoneList categories
GET/api/page-categories/[slug]NoneCategory detail
POST/api/page-categories/seedhomepage:updateSeed categories
GET/POST/api/page-configurationshomepage:read/updatePage config CRUD
PUT/api/page-configurations/[docId]homepage:updateUpdate page config
POST/api/page-configurations/[docId]/publishhomepage:updatePublish page config
GET/POST/PUT/DELETE/api/static-pages/*homepage:updateStatic page CRUD
GET/PUT/api/settings/navigationNAVIGATION_READ/UPDATENavigation config
GET/PUT/api/settings/appearanceNAVIGATION_READ/UPDATEAppearance config
POST/api/preview/sessionAuth requiredCreate preview session
Email Template APIs
MethodEndpointPermissionPurpose
GET/api/settings/email-templatesSETTINGS_READList templates
POST/api/settings/email-templatesSETTINGS_UPDATECreate template
PUT/api/settings/email-templates/[id]SETTINGS_UPDATEUpdate template
DELETE/api/settings/email-templates/[id]SETTINGS_UPDATEDelete template
POST/api/settings/email-templates/[id]/testSETTINGS_UPDATESend test email
POST/api/settings/email-templates/seedSETTINGS_UPDATESeed default templates
GET/PUT/api/settings/email-preferencesSETTINGS_READ/UPDATEBranding/preferences
GET/api/settings/smtp/statusSETTINGS_READSMTP health check
B. Template Status Enum
StatusDescription
draftTemplate is being edited, not published
activeTemplate is published and in use
inactiveTemplate is deactivated but preserved
archivedTemplate is archived (built-in protection)
C. Email Status Enum
StatusDescription
pendingEmail queued for sending
sentEmail successfully delivered
failedEmail delivery failed
bouncedEmail bounced (hard/soft)
D. 21 Built-In Page Categories
#SlugLabelTemplates
1homepageHomepageEditorial Classic, Magazine Grid, Featured Hero, Minimal Reader
2articleArticleStandard, Immersive, Minimal
3sectionSectionGrid, List, Magazine
4indexIndexGrid, List, Cards
5authorAuthorProfile, Minimal
6subscriptionSubscriptionPricing Cards, Pricing Comparison
7searchSearchInteractive
8staticStaticStandard, Centered
9campaignCampaignMultiple variants
10tagTagTag-specific layouts
11archiveArchiveTimeline, grid variants
12magazine-issuesMagazine IssuesIssue viewer
13shopShopE-commerce layouts
14eventEventEvent page layouts
15podcastPodcastPodcast page layouts
16collectionCollectionCurated collection layouts
17institutionalInstitutionalInstitutional subscription
18accountAccountReader account layouts
19newsletter-archiveNewsletter ArchiveNewsletter browse
20giftGiftGift subscription
21errorError404, 500 pages
E. 20 Seeded Email Template Keys
#KeyCategoryDescription
1subscription_welcomeSubscriptionNew subscriber welcome
2subscription_renewal_reminderSubscriptionRenewal reminder
3subscription_expirationSubscriptionExpiration notice
4subscription_payment_receiptSubscriptionPayment receipt
5future_readers_couponSubscriptionCoupon/promo code
6institutional_inviteSubscriptionInstitutional invitation
7gift_subscription_activationSubscriptionGift activation
8campaign_submission_approvedCampaignSubmission approved
9campaign_submission_rejectedCampaignSubmission rejected
10campaign_invitationCampaignCampaign invitation
11campaign_notify_new_campaignCampaignNew campaign notification
12new_article_submissionNotificationNew submission alert
13article_reassignedNotificationArticle reassigned
14action_neededNotificationAction required
15author_responseNotificationAuthor responded
16ready_for_reviewNotificationReady for review
17publishing_approvedNotificationPublishing approved
18change_requestedNotificationChanges requested
19article_liveNotificationArticle published
20otp_verificationSystemOTP code
F. Glossary
TermDefinition
SectionA modular, reusable layout block within a page template (e.g., hero, grid, list)
Section VariantA specific visual implementation of a section type (e.g., HeroFullWidth, Grid3Column)
TemplateA complete page layout composed of ordered sections with default styles
Page ConfigurationA Strapi document binding a page type to a template with specific section configurations
Content SourceHow a section gets its content: dynamic (query-based), manual (hand-picked), mixed, or static
ISRIncremental Static Regeneration — Next.js feature for on-demand page cache refresh
HMACHash-based Message Authentication Code — used for secure unsubscribe tokens
Email ClassClassification of email type determining compliance behavior (mandatory-transactional, lifecycle, operational, marketing)
Email PipelineThe canonical path for rendering and sending emails: resolve template → replace variables → wrap branding → send → log
Branding WrapperHTML shell applied to all emails with header, footer, logo, and styling from EmailPreferences
VAPIDVoluntary Application Server Identification — web push notification authentication

On this page

1. Executive OverviewWhat This Module DoesWho Uses ItBusiness Problem Solved2. Feature ScopeIn ScopePage Template SystemEmail Template SystemOut of ScopeRelated Modules / Dependencies3. Roles InvolvedPage Template SystemEmail Template SystemRBAC Permissions Required4. Architecture & Design OverviewSystem ArchitectureData Flow — Page TemplatesData Flow — Email TemplatesKey Entities & ModelsPage Template Models (PostgreSQL/Prisma)Strapi Content TypesEmail Models (PostgreSQL/Prisma)Settings Precedence Model5. Prerequisites & Setup RequirementsInfrastructure PrerequisitesEnvironment Variables RequiredAdmin ConsoleReader PortalModule Dependencies (Must Be Set Up First)Seed Data InitializationStrapi Content Types Required6. Configuration Guide — Page Template System6.1 Accessing the Template System6.2 Understanding Page Categories6.3 Working with the Template Canvas EditorOpening the EditorAdding SectionsConfiguring Section PropertiesSection Variant CategoriesReordering SectionsRemoving SectionsLive Preview6.4 Template Versioning6.5 Publishing Templates6.6 Managing Static Pages6.7 Managing NavigationHeader LinksFooter Configuration6.8 Theme & Appearance7. Configuration Guide — Email Template System7.1 Accessing Email Templates7.2 Initial Setup — Seed Default Templates7.3 Creating / Editing Email Templates7.4 Using Template VariablesSystem Variables (Auto-Injected)CRM Variables (Auto-Injected from CRM Settings)Context-Specific Variables7.5 Previewing Email Templates7.6 Sending Test Emails7.7 Configuring Email Branding (Preferences)7.8 SMTP / Provider Configuration7.9 Viewing Email Logs8. How the Page Template System Works End to End8.1 Template Lifecycle8.2 What Happens When You Publish8.3 Reader Portal Rendering Pipeline8.4 Section Data Resolution9. How the Email Template System Works End to End9.1 Email Pipeline Flow9.2 Email Classes and Compliance9.3 Unsubscribe Flow10. Business Logic & RulesPage Template RulesEmail Template RulesStyle Precedence11. Use Cases & Operational ScenariosPage Template Use CasesEmail Template Use Cases12. End-to-End User FlowsFlow 1: Create and Publish a New Page TemplateFlow 2: Customize and Test an Email TemplateFlow 3: Configure Email BrandingFlow 4: Manage Site Appearance and Navigation