Email Templates
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) → Email Templates.
What it is / when to use
Catalog of the platform's transactional templates — the specific content of each system email (welcome, password recovery, confirmations, codes, etc.). Each template has a version in Portuguese and English, and may also carry an equivalent SMS text. Use it to edit the text/HTML the system fires automatically for each event, without touching the code.
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 frame (header/footer/brand) surrounding this content comes from the Master Template.
Step by step
- Access the Communication → Email Templates menu.
- The screen lists the existing templates; use the search to filter by
idor subject (pt/en). - Click View to open the preview directly, or Edit to open the editor.
- In the editor, adjust the subject/HTML/SMS per language using the tabs.
- Preview and Save.
Fields
Listing
| Column | What it shows | Data source |
|---|---|---|
Id (id) | Template identifier (the key the system uses to fire it) | email_template.id |
Subject (subject) | Subject in Portuguese | subject |
Has English (hasEnglish) | Whether there is a filled English version | derived from subject_en/htmlData_en |
Has SMS (hasSms) | Whether there is an associated SMS text | derived from sms/sms_en |
| Actions | View / Edit | — |
Editor (modal)
| Field | What it is | Required? | System/backend effect |
|---|---|---|---|
Subject (subject / subject_en) | Email subject per language | Yes (at least pt) | Saved in the template; used as subject in the automatic dispatch. |
HTML (htmlData / htmlData_en) | Email HTML body per language | Yes | Content rendered inside the Master Template frame. |
Plain text body (body) | Plain text version (fallback) | No | Text alternative when applicable. |
SMS (sms / sms_en) | Short text for the SMS channel of the same event | No | Allows the same event to also trigger an SMS. |
From / To (from / to) | Sender/recipient metadata of the template | No | Auxiliary template fields. |
Editor placeholders
The preview replaces markers with real data (logged-in user):
| Placeholder | Replaced by |
|---|---|
@name@ | User's name |
@email@ | User's email |
@date@ | Current date (pt-BR) |
@link@ | Platform base origin/URL |
@code@ | 6-digit numeric code (example, for verification emails) |
Actions and modals
- View: opens the editor in read-only mode with the preview opened directly (
openPreviewDirectly). If the template has no content, it warns that there is nothing to display. - Edit: opens the editor with tabs; upon Save, sends the template to the backend (
updateEmailTemplate). On success, closes and reloads the list; on error, keeps it open with a warning. - Preview (pt / en): builds the HTML for the chosen language with placeholders resolved and renders it in an
iframe. Warns if the chosen language is empty. - Search: filters the table by
id,subject, orsubject_en.
Business rules / cautions
Attention
- The template
idis the dispatch key used by the system. Do not invent or rename ids: change content, not the key, or the event will stop finding the template. - Keep pt and en consistent; an empty language degrades the experience for users in that locale.
- Email HTML is restrictive (tables + inline styles). Validate in the preview before saving.
- Placeholders in the preview use the logged-in operator's data (for viewing only); in the actual send, they are filled with the recipient's/event's data.
- Cross-provider rendering: content sent via
SimpleEmailService(bodyData+htmlData). Broken HTML may become plain text in Mailgun/Brevo/SendGrid; SES masks the issue.