Skip to content

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 admin guard. 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

  1. Access the Communication → Master Template menu.
  2. The screen loads the default template and populates both editors: HTML (pt) and HTML (en).
  3. Edit the HTML in each language.
  4. Click Preview (pt or en) to open a rendered preview with real tenant data.
  5. Click Save to persist the changes.

Fields

FieldWhat it isRequired?System/backend effect
HTML (pt) (htmlData)HTML frame of the email in PortugueseYesSaved to main_template.htmlData of the default record (CommunicationGateway). Wraps the content of every email sent.
HTML (en) (htmlData_en)HTML frame in EnglishYesSaved 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:

PlaceholderReplaced 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_en is left empty, emails in English lose their frame.
  • Cross-provider rendering: the frame is applied to the content and sent via SimpleEmailService, which populates bodyData and htmlData. Broken HTML may render as plain text in Mailgun/Brevo/SendGrid (SES masks the issue).