Templates

Templates efficiently replicate content across resources

Templates are reusable content wrappers that give your emails, pages, and resources a consistent layout. Instead of rebuilding shared elements (headers, footers, navigation, branding) for every piece of content, you design them once in a template and assign it wherever needed.

Templates can be assigned to Messages, Auto Responders, Pages, and Resources.

Navigate to Administration > Templates

Need help building responsive, production-ready templates? OptiPub provides white-glove support for template creation. Reach out to our team and we'll work with you to design and build templates tailored to your brand.


Templates Table

The templates list shows all templates in your account. Available columns:

ColumnDescription
IDUnique identifier
NameThe template name
All PublicationsWhether the template is available to every publication
PublicationsThe specific publications the template is associated with
CategoryThe template category (e.g. Auto Responder, Free Style, Page)
Template TypeMessage, Content, or Resource
Message TypeThe message type, if applicable (organizational only)
TagsTags applied to the template

Templates can be copied from the action menu to use an existing template as a starting point. The table also supports export for bulk data extraction.


Creating a Template

Click Create to open the template form. The form is split into three steps: General, Content, and Preview.

Step 1 β€” General

FieldRequiredDescription
NameYesA descriptive name for the template
CategoryYesThe template category β€” determines which content types can use this template (see Template Categories)
Available for All Publicationsβ€”Toggle on to make the template available to every publication
Associated PublicationsWhen not "all"Select which publications can use this template
TagsNoOptional tags for organizing and filtering templates

Step 2 β€” Content

Build your template content using the GrapesJS drag-and-drop visual editor. The editor provides a full suite of layout and design tools for building responsive HTML content without writing code.

For Message and Content type templates, a Template Content block is available β€” this inserts the {$sys_email.content} macro that defines where the assigned resource's content will be rendered inside the template.

Importing Content

Click the Import button in the editor toolbar to bring in content from several sources:

SourceDescription
Browse TemplatesLoad content from an existing template in your account. Search, filter by publication, and filter by tags to find the right one
Google DocsPaste a public Google Docs URL to import the document's content directly into the editor
ActiveCampaignImport HTML from an ActiveCampaign campaign message (requires ActiveCampaign integration to be configured under Settings > Integrations)
Upload HTML FileUpload an .html file from your computer
Paste HTML/CSSOpen a code editor to paste or write raw HTML and CSS

Step 3 β€” Preview

Preview the final rendered template with macros resolved. This shows how the template will look when applied to content. Use this step to verify the layout before saving.


Template Categories

Template categories organize your templates and control which content types can use them. Manage categories under Administration > System Settings > Categories > Template Categories.

Category Types

The category type determines where templates in that category can be assigned:

TypeAvailable For
MessageMessages, Auto Responders, and other email content
ContentPages and other website content
ResourceResource templates

Message Types

Categories with the Message type can optionally be associated with a specific message type (e.g. Article Mailing, Promo Mailing). This is for organizational purposes only β€” messages can use templates from any Message type category regardless of the message type label.

Default Categories

OptiPub comes with these built-in template categories:

  • Auto Responder
  • Article Mailing
  • Promo Mailing
  • Renewal Mailing
  • Linkfest
  • Free Style
  • Page

Creating a Category

FieldRequiredDescription
NameYesThe category name (must be unique)
Template TypeYesMessage, Content, or Resource
Message TypeNoOptional message type association
Parent CategoryNoOptional parent for hierarchical organization

Macros in Templates

Templates support the full range of OptiPub macros β€” System Macros, Custom Content, and Variables.

Key Template Macros

MacroDescription
{$sys_email.content}Template-specific. Marks where the resource content is placed inside the template
{$sys_email.subject}The message subject line
{$email}The recipient's email address
{$sys_email_unsubscribe}A unique unsubscribe URL for the recipient

Publication Macros

  • {$sys_division.[setting]} β€” values defined in publication settings
  • {$sys_publication.[setting]} β€” values defined when creating a publication

Configure these in Administration > Publications.

Smarty Template Engine

Messages and Auto Responders can render Smarty values in templates. Landing Pages and Pages cannot.

A useful Smarty value for message templates is {$smarty.now|date_format} for dynamic dates. See the Smarty documentation for custom format strings.

FormatOutput
{$smarty.now|date_format}Dec 31, 2024
{$smarty.now|date_format:"%b %e, %Y"}Dec 31, 2024
{$smarty.now|date_format:"%A, %B %e, %Y"}Tuesday, December 31, 2024

Where Templates Are Used

Templates are referenced across multiple content types:

  • Messages β€” wrap email content in a branded layout
  • Auto Responders β€” apply consistent formatting to automated email sequences
  • Pages β€” provide a shared page shell (header, footer, navigation) for website pages
  • Resources β€” standardize the layout of resource content

When creating or editing any of these content types, select a template in the form options. The Confirm or Preview step shows the content rendered inside the chosen template.