Hyphen User Guides

Layout & Design Templates

Complete guide to global appearance & theme tokens, banners & announcements, navigation, page categories, and the email template system — with end-to-end data flow, configuration reference, and diagrams

Version 1.4|Updated 2026-06-23|QA Teams, Platform Admins, Customer Operators, Implementation Teams

Scope of this guide

This guide is the reference for the global design layer of the platform: Appearance & Theme tokens (colors, typography, spacing, badges), Banners & Announcements, Navigation (header + footer), Page Categories, and the Email Template system. Together these decide how every Reader Portal page and every outbound email looks.

The page/section layout builder — the drag-and-drop canvas, the 176+ section variants, per-page template binding, and publishing individual pages — has its own dedicated reference at Page Template System. The multi-account email delivery layer (provider accounts, purpose routing, suppressions, the send dashboard) lives in the Email System Guide. This guide cross-links to both at every boundary.

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

Layout & Design system architecture — Admin Console editors write to Postgres (Prisma) and mirror published data to Strapi, which the Reader Portal renders through its template/theme pipeline.

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 (Settings → Email → Templates)
  2. API saves to PostgreSQL (EmailTemplate model). Each template carries a defaultPurposeKey that drives downstream routing.
  3. System event triggers email (subscription welcome, OTP, campaign send, etc.)
  4. Email Pipeline resolves the template's purpose → looks up the primary account for that purpose at EmailPurposeAccount → decrypts that account's credentials → replaces variables → wraps with branding → sends via the resolved provider → logs to EmailLog with purposeKey + emailAccountId
  5. Admin views delivery status in Settings → Email → Logs and aggregate analytics in Settings → Email → Dashboard

Multi-account routing is the delivery model: each canonical purpose routes to its own provider account. See the Email System Guide for the admin-facing details.

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), curated Section / Tag / Language multi-select filters (for article sources), status filter, max items, sort order, pagination, entity picker, and (on article grids) the optional reader-facing filter dropdowns described below
DetailEntity reference, display fields, related content config
ContextualRelationship type, related entity config, plus the same curated Tag / Language scope filters for article sources
StaticTitle, subtitle, body text, CTA button, image
Curated editor filters vs. reader-facing filters

There are two distinct filter layers, and it helps to keep them apart:

  1. Curated editor (scope) filters — In the Properties Panel, article-sourced Listing and Contextual sections expose multi-select Section / Tag / Language dropdowns. These narrow what the section pulls (its base scope) and are baked into the published configuration. Readers never see these controls; they only see the resulting content.
  2. Reader-facing per-grid filters — Article grids can additionally expose live Language / Author / Section (Category) dropdowns above the grid on the Reader Portal. These let the reader re-filter within the section's base scope. They are opt-in per section (see §6.9) and default to off, so a grid shows no reader controls unless you enable them.

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
ColorsprimaryColor, secondaryColor, accentColor, and ctaColor (the call-to-action / button colour). colorTheme selects a named palette preset
TypographyfontTheme (e.g. editorial) drives heading/body font pairing; bylineStyle (plain / italic); sectionLabelCase (uppercase / etc.) controls how section/category labels are cased
Spacing & Layoutspacing (compact/normal/relaxed), containerWidth (standard / wide), section spacing
Header & FooterheaderStyle (e.g. sticky), footerStyle (e.g. editorial), footerLogoUrl, and sectionNavStyle (placement of the in-page section nav, e.g. top-right)
Shape / BordersborderStyle (e.g. rounded) and borderRadius set the global corner treatment for cards, buttons, and chips. Certain elements (carousel indicators, comment/author avatars) stay circular regardless of this setting by design
Tags & BadgestagBorderEnabled, tagBackgroundColor, tagBorderColor style article tags; per-section badge colours (badgeFictionColor, badgePoetryColor, badgeEssayColor, badgeInterviewColor, and arbitrary sectionBadgeColors) tint category labels
AnnouncementsannouncementBgColor, announcementTextColor, announcementLinkColor style the promo/announcement strip
Custom CSScustomCss for advanced overrides

These defaults mirror the Figma "The Hyphen" design system and are kept in sync across three places: the reader globals.css :root, the reader /api/appearance structural defaults, and the admin appearance route. Changing a token in the admin overrides the corresponding default.

Changes sync to Strapi site-appearance and are consumed by the Reader Portal's ThemeProvider, which applies them as CSS variables and prefixed Tailwind classes (theme-, font-theme-, spacing-, container-width-, header-style-, footer-style-, border-style-, section-nav-).

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

6.9 Reader-Facing Per-Grid Filters (Language / Author / Section)

Article grids can optionally expose live filter dropdowns to readers, letting them re-filter a grid in place. This is opt-in per section and defaults to off, so a grid shows no reader controls unless you enable them.

Supported grid variants: Grid2Column, Grid3Column, Grid4Carousel, Grid2WithSidebar, and the section-page article grid (SectionArticleGrid).

Configuration (per section, in the Properties Panel): an articleFilters config with:

FieldEffect
enabledMaster switch — filters render only when this is true AND at least one dimension below is enabled
languageShow the Language dropdown (options from /api/articles/languages)
authorShow the Author dropdown (options from /api/authors)
sectionShow the Category dropdown (options from /api/sections)

How it behaves on the Reader Portal:

  • No filter selected — the grid uses its server-rendered (SSR) article pool and paginates client-side. No extra network calls.
  • A filter selected — the grid re-fetches server-side via GET /api/articles, combining the reader's selection with the section's base scope (the section's own filters plus any page-level section/author scope, e.g. on a Section or Author page). Results re-paginate from page 1.
  • Each enabled dropdown defaults to "All …". If its option list fails to load, the dropdown still renders at its default so the grid never breaks.
  • A small feedback line handles loading ("Loading articles…"), empty ("No articles match these filters."), and error (with a "Try again" retry) states.
  • Selections respect the same base scope, so a grid on /fiction filtered by Author still only shows that author's fiction.

The styling reuses the same shared FilterDropdown as the standalone utility-article-filter bar, so the two look identical. You can exercise all three dropdowns on the grid variants in /preview/sections.


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 Email sidebar group:

Menu ItemPathPurpose
Email → Dashboard/settings/emails/dashboardKPI strip + per-account / per-purpose breakdowns + daily volume chart + unsubscribe analytics
Email → Templates/settings/emailsBrowse and manage all email templates (each carries a defaultPurposeKey)
Email → Accounts/settings/emails/accountsProvider connections: SMTP / SendGrid / Mailchimp Transactional / AWS SES / Postmark
Email → Purposes/settings/emails/purposesMap every canonical purpose to a primary account
Email → Suppressions/settings/emails/suppressionsLocal mirror of bounce / complaint / unsubscribe / GDPR records
Email → Logs/settings/emails/logsRow-level delivery records, filterable by status / template / account / purpose / bounce class

/settings/emails/config redirects to /settings/emails/accounts. The full guide is at Email System Guide.

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 Provider Configuration (Email Accounts)

Navigate to Settings → Email → Accounts and click + New email account, or click an existing row to edit:

  1. Pick a provider: Custom SMTP, SendGrid, Mailchimp Transactional, AWS SES, or Postmark (immutable after save).
  2. Enter provider credentials. The form encrypts them at rest with AES-256-GCM.
  3. Set the sender identity (from name, from email, optional reply-to and return-path).
  4. Click Save & connect — saves AND runs a connection probe in one action. The result is shown inline (latency on success, the provider's actual error message on failure).
  5. To re-verify later, use Verify connection in the Diagnostics card on the account detail page. To send an actual templated probe, use Send test email in the same card.

Multiple accounts coexist side by side. Map each canonical email purpose to a primary account at Settings → Email → Purposes. The pipeline reads this mapping at every send. After every save, the resolver cache and per-account transporter are invalidated automatically — no server restart required.

7.9 Viewing Email Logs

Navigate to Settings → Email → 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

Page template lifecycle — from creation in the Admin Console to rendering on the Reader Portal.

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)

When a grid has reader-facing filters enabled (§6.9), the initial render uses the resolved dynamic/mixed pool, but a reader selection triggers a client-side server refetch (GET /api/articles) that re-applies the section's base scope plus the chosen Language / Author / Section value.


9. How the Email Template System Works End to End

9.1 Email Pipeline Flow

Email pipeline — a system event resolves a template, injects variables, wraps with branding, and sends via the configured provider, logging the result.

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
11Let readers filter a gridSelect an article grid → Properties Panel → enable articleFilters (Language / Author / Section) → Publish → readers see live dropdowns above the grid
12Scope a grid in the editorSelect an article Listing section → set the curated Section / Tag / Language multi-select filters → only matching articles are pulled
13Restyle to brandSettings > Appearance → adjust ctaColor, borderStyle, tag/badge colours, sectionLabelCase → Preview → Save

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

Known Limitations

Page Template System

ItemDescriptionSeverityWorkaround
No A/B testingYou cannot test multiple template variants against each otherLowManually switch templates and compare analytics
Single editor at a timeThere is no collaborative editing or lockingMediumCoordinate edits via team communication
No template import/exportYou cannot transfer templates between environmentsMediumManual database migration

Email Template System

ItemDescriptionSeverityWorkaround
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 an external HTML email builder, then paste the HTML
VAPID keys must be generated manuallyPush notification keys are not auto-generatedLowRun npx web-push generate-vapid-keys during setup
Self-hosted social icons pendingEmail footer social icons load from an external CDNLowReplace with self-hosted assets in production
Institution inquiry templates hardcodedCRM email drafts live in the route file, not in the databaseLowIntentional design — used as pre-written drafts for sales staff
Integration deep wiring partialSome integration settings are not fully connected to SDK initializationMediumConfigure directly via env vars

FAQ

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 PropertiesCurated editor filters vs. reader-facing filtersSection Variant CategoriesReordering SectionsRemoving SectionsLive Preview6.4 Template Versioning6.5 Publishing Templates6.6 Managing Static Pages6.7 Managing NavigationHeader LinksFooter Configuration6.8 Theme & Appearance6.9 Reader-Facing Per-Grid Filters (Language / Author / Section)7. 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 Provider Configuration (Email Accounts)7.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 NavigationKnown LimitationsPage Template SystemEmail Template SystemFAQ