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:
| Column | Description |
|---|---|
| ID | Unique identifier |
| Name | The template name |
| All Publications | Whether the template is available to every publication |
| Publications | The specific publications the template is associated with |
| Category | The template category (e.g. Auto Responder, Free Style, Page) |
| Template Type | Message, Content, or Resource |
| Message Type | The message type, if applicable (organizational only) |
| Tags | Tags 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
| Field | Required | Description |
|---|---|---|
| Name | Yes | A descriptive name for the template |
| Category | Yes | The 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 Publications | When not "all" | Select which publications can use this template |
| Tags | No | Optional 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:
| Source | Description |
|---|---|
| Browse Templates | Load content from an existing template in your account. Search, filter by publication, and filter by tags to find the right one |
| Google Docs | Paste a public Google Docs URL to import the document's content directly into the editor |
| ActiveCampaign | Import HTML from an ActiveCampaign campaign message (requires ActiveCampaign integration to be configured under Settings > Integrations) |
| Upload HTML File | Upload an .html file from your computer |
| Paste HTML/CSS | Open 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:
| Type | Available For |
|---|---|
| Message | Messages, Auto Responders, and other email content |
| Content | Pages and other website content |
| Resource | Resource 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
| Field | Required | Description |
|---|---|---|
| Name | Yes | The category name (must be unique) |
| Template Type | Yes | Message, Content, or Resource |
| Message Type | No | Optional message type association |
| Parent Category | No | Optional parent for hierarchical organization |
Macros in Templates
Templates support the full range of OptiPub macros β System Macros, Custom Content, and Variables.
Key Template Macros
| Macro | Description |
|---|---|
{$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.
| Format | Output |
|---|---|
{$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.
Updated 5 days ago
