Master Template
Access prerequisites
- Permission (module): access granted by the route administrative guard (
admin). There is no specific dynamic module for this screen. - License/Feature: None.
- Menu container: GENERAL → Communication group (icon
campaign) → Master Template.
What it is / when to use
The Master Template is the single, global HTML "envelope" (id = 'default') that wraps all transactional and campaign emails on the platform — header, footer, logo, brand colors, and social media links. You edit the HTML here in Portuguese and in English, and the backend applies it as a frame around the specific content of each email. Use it whenever you need to adjust the visual identity, institutional links, or the structure common to all emails in one go.
Prerequisites
- Permission: item under the route
adminguard. Permission in Axia is dual (CPM enum + dynamic module in DB); here the gate is the route guard. - License/Feature: none.
- Dependencies on other screens: the "body" content of individual emails is maintained in Email Templates; the Master Template provides the frame around that content.
Step by step
- Access the Communication → Master Template menu.
- The screen loads the
defaulttemplate and populates both editors: HTML (pt) and HTML (en). - Edit the HTML in each language.
- Click Preview (pt or en) to open a rendered preview with real tenant data.
- Click Save to persist the changes.
Fields
| Field | What it is | Required? | System/backend effect |
|---|---|---|---|
HTML (pt) (htmlData) | HTML frame of the email in Portuguese | Yes | Saved to main_template.htmlData of the default record (CommunicationGateway). Wraps the content of every email sent. |
HTML (en) (htmlData_en) | HTML frame in English | Yes | Saved to main_template.htmlData_en. Used when the email is sent in English. |
Placeholders replaced in the preview (and on send)
The preview substitutes @...@ markers with real tenant data (sourced from getAllExternalLinks + the logged-in user). Use exactly these tokens in the HTML:
| Placeholder | Replaced by |
|---|---|
@CUSTOMER_LOGO@ | Tenant logo URL (fallback /assets/menu/company_logo.png) |
@CUSTOMER@ | Tenant name (derived from hostname, capitalized) |
@CUSTOMER_PRIMARY@ | Brand primary color (fallback #4CAF50) |
@CUSTOMER_SECONDARY@ | Brand secondary color (fallback #2196F3) |
@CUSTOMER_WEBSITE@ | Institutional website ("About us" field / origin) |
@INSTAGRAM@ / @FACEBOOK@ / @LINKEDIN@ / @TELEGRAM@ | Tenant social media URLs |
Actions and modals
- Preview (pt / en): assembles the HTML for the chosen language with resolved placeholders and opens the preview in an
iframe(local Blob). This is view-only — nothing is saved. - Save: sends
{ id: 'default', htmlData, htmlData_en }to the backend. On success, displays "Master Template updated successfully!"; on error, a failure message is shown. The preview does not persist anything.
Business rules / considerations
Attention
- There is one single Master Template per environment (
id = 'default'). Editing it affects all emails that use the frame — validate with the preview in both languages before saving. - Email HTML is restrictive. Prefer tables and inline styles; modern CSS features may not render in clients such as Outlook/Gmail.
- Keep the
@...@placeholders intact; removing them causes the brand/links to disappear from emails. - Edit both languages: if
htmlData_enis left empty, emails in English lose their frame.
- Cross-provider rendering: the frame is applied to the content and sent via
SimpleEmailService, which populatesbodyDataandhtmlData. Broken HTML may render as plain text in Mailgun/Brevo/SendGrid (SES masks the issue).