Ctrl K
ring2all.com

Email Templates Module Documentation

Table of Contents

  1. Module Overview (Technical)
  2. Module Overview (Commercial/Business)
  3. Module Overview (End User/Administrator)
  4. Configuration Sections
  5. Settings Reference
  6. Common Scenarios & Examples
  7. Limitations & Important Notes
  8. Troubleshooting Tips
  9. Glossary

---

1. Module Overview (Technical)

What Are Email Templates?

Email Templates is a notification template module that manages customizable email layouts for system notifications. Templates support HTML and plain text content with variable substitution for dynamic data.

Architecture

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Email Templates Architecture                      │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Email Template Definition                                      │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │        Template: New Voicemail                           │   │
│  │                                                          │   │
│  │  Basic Info:                                             │   │
│  │  ├─ Name: New Voicemail Notification                    │   │
│  │  ├─ Slug: new-voicemail                                 │   │
│  │  ├─ Subject: New voicemail from {{caller_name}}         │   │
│  │  ├─ From: voicemail@company.com                         │   │
│  │  └─ Status: Active                                       │   │
│  │                                                          │   │
│  │  Content:                                                │   │
│  │  ├─ HTML: <html>... {{caller_name}} ...</html>          │   │
│  │  └─ Plain Text: You have a new voicemail...             │   │
│  │                                                          │   │
│  │  Variables: {{caller_name}}, {{duration}}, {{date}}     │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼ Used by notification system                            │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │        Email Sender                                      │   │
│  │                                                          │   │
│  │  1. Receive notification request                        │   │
│  │  2. Find template by slug                               │   │
│  │  3. Replace variables with actual values                │   │
│  │  4. Send via SMTP (Email Settings)                      │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key Tables

TablePurpose
public.email_templatesTemplate definitions

Key Files

FileDescription
modules/emailTemplates/Frontend module
---

2. Module Overview (Commercial/Business)

Business Value

Email Templates provides branded communications:

Without Email TemplatesWith Email Templates
Generic emailsBranded design
Fixed contentCustomizable
No variablesDynamic data
One formatHTML + Plain text

Use Cases

  1. Voicemail Notifications
- Customize voicemail email layout

- Include caller info dynamically

  1. System Alerts
- Branded alert design

- Consistent formatting

  1. User Notifications
- Password reset emails

- Account notifications

  1. Fax Notifications
- Fax receipt emails

- Custom branding

Feature Highlights

FeatureBenefit
Slug IdentifierSystem lookup
HTML ContentRich formatting
Plain TextFallback support
VariablesDynamic content
Sender OverridePer-template sender
Active/InactiveEnable/disable
---

3. Module Overview (End User/Administrator)

What Can You Do?

  • Create email templates
  • Customize HTML and plain text content
  • Use variables for dynamic data
  • Override sender information
  • Enable/disable templates
  • Duplicate existing templates

Email Templates Interface

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Email Templates                                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Manage system email templates for notifications and alerts    │
│                                                                 │
│  [+ New Template]                                               │
│                                                                 │
│  [🔍 Search templates...]                                       │
│                                                                 │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ Name           │ Slug           │ Subject       │ Status │  │
│  ├────────────────┼────────────────┼───────────────┼────────┤  │
│  │ New Voicemail  │ new-voicemail  │ New voicemail │ Active │  │
│  │ Fax Received   │ fax-received   │ Fax from...   │ Active │  │
│  │ Password Reset │ password-reset │ Reset your... │ Active │  │
│  │ System Alert   │ system-alert   │ Alert: ...    │ Active │  │
│  └───────────────────────────────────────────────────────────┘  │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Create/Edit Template

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Edit Template: New Voicemail                       │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ▼ Basic Information                                            │
│                                                                 │
│  Name: [New Voicemail Notification       ]                     │
│    Personalized name for the template                           │
│                                                                 │
│  Slug (Identifier): [new-voicemail       ]                     │
│    Unique identifier used by the system                         │
│                                                                 │
│  Subject: [New voicemail from {{caller_name}}]                 │
│    The subject line that recipients will see                    │
│                                                                 │
│  From Email: [voicemail@company.com      ]                     │
│    Override the default sender email                            │
│                                                                 │
│  From Name: [Company Voicemail           ]                     │
│    Override the default sender name                             │
│                                                                 │
│  ──────────────────────────────────────────────────────────────│
│                                                                 │
│  ▼ Template Content                                             │
│                                                                 │
│  HTML Content:                                                  │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │ <!DOCTYPE html>                                            ││
│  │ <html>                                                     ││
│  │ <body style="font-family: Arial, sans-serif;">            ││
│  │   <h2>New Voicemail</h2>                                  ││
│  │   <p>You have a new voicemail from <b>{{caller_name}}</b> ││
│  │   ({{caller_number}}).</p>                                ││
│  │   <p>Duration: {{duration}}</p>                           ││
│  │   <p>Received: {{date}}</p>                               ││
│  │ </body>                                                    ││
│  │ </html>                                                    ││
│  └─────────────────────────────────────────────────────────────┘│
│                                                                 │
│  Plain Text Content:                                            │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │ New Voicemail                                              ││
│  │                                                             ││
│  │ You have a new voicemail from {{caller_name}}              ││
│  │ ({{caller_number}}).                                       ││
│  │ Duration: {{duration}}                                     ││
│  │ Received: {{date}}                                         ││
│  └─────────────────────────────────────────────────────────────┘│
│                                                                 │
│  ──────────────────────────────────────────────────────────────│
│                                                                 │
│  ▼ Available Variables                                          │
│                                                                 │
│  Click on a variable to insert it into the editor              │
│                                                                 │
│  [{{caller_name}}] [{{caller_number}}] [{{duration}}]          │
│  [{{date}}] [{{time}}] [{{extension}}] [{{mailbox}}]           │
│                                                                 │
│  ──────────────────────────────────────────────────────────────│
│                                                                 │
│  ▼ Status                                                       │
│                                                                 │
│  Active: ✓                                                     │
│    Enable or disable this template                              │
│                                                                 │
│  [Save Template] [Cancel]                                       │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Quick Tips

TIP
Click to Insert: Click variables to insert at cursor position.
TIP
Both Formats: Always provide HTML and plain text versions.
NOTE
Slug Unique: Each template needs a unique slug identifier.

---

4. Configuration Sections

Basic Information

FieldDescription
NameDisplay name
SlugSystem identifier
SubjectEmail subject line
From EmailSender email override
From NameSender name override

Template Content

FieldDescription
HTML ContentRich text version
Plain TextFallback version

Available Variables

FieldDescription
VariablesClick to insert

Status

FieldDescription
ActiveEnable/disable template
---

5. Settings Reference

Common Template Slugs

SlugPurpose
new-voicemailVoicemail notification
fax-receivedFax receipt notification
password-resetPassword reset request
system-alertSystem alerts
missed-callMissed call notification
account-welcomeNew account welcome

Common Variables

VariableDescription
{{caller_name}}Caller's name
{{caller_number}}Caller's phone number
{{extension}}Extension number
{{mailbox}}Voicemail mailbox
{{duration}}Call/message duration
{{date}}Date of event
{{time}}Time of event
{{company_name}}Company name
{{user_name}}Recipient name

HTML Best Practices

PracticeRecommendation
Inline CSSUse inline styles
Simple LayoutTable-based layout
Fallback FontsSystem font stack
Alt TextFor all images
WidthMax 600px
---

6. Common Scenarios & Examples

Scenario 1: Customize Voicemail Email

  1. Find template "new-voicemail"
  2. Edit HTML content
  3. Add company logo
  4. Customize styling
  5. Update plain text
  6. Save

Scenario 2: Create New Template

  1. Click New Template
  2. Enter name and slug
  3. Write subject with variables
  4. Create HTML content
  5. Create plain text fallback
  6. Enable and save

Scenario 3: Add Company Branding

Html
<!DOCTYPE html>
<html>
<body style="font-family: Arial; background: #f5f5f5; padding: 20px;">
  <div style="max-width: 600px; margin: 0 auto; background: white; padding: 20px;">
    <img src="https://company.com/logo.png" alt="Company" style="max-width: 150px;">
    <h2 style="color: #333;">{{subject}}</h2>
    <p>{{content}}</p>
    <hr style="border: 1px solid #eee;">
    <p style="color: #666; font-size: 12px;">© 2025 Company Name</p>
  </div>
</body>
</html>

Scenario 4: Variable Usage

Subject:

Plaintext
New voicemail from {{caller_name}} ({{caller_number}})

Result:

Plaintext
New voicemail from John Smith (+1-555-123-4567)

---

7. Limitations & Important Notes

Technical Notes

NOTE
Slug Immutable: Don't change slug of system templates.
NOTE
Plain Text Required: Some clients don't support HTML.
WARNING
Test Templates: Verify rendering in different clients.

Best Practices

  1. Both Formats: Always provide HTML + plain text
  2. Inline CSS: External styles don't work in email
  3. Test Widely: Check Gmail, Outlook, Apple Mail
  4. Keep Simple: Complex layouts may break
  5. Use Variables: Make content dynamic

Email Client Compatibility

ClientHTML SupportNotes
GmailGoodStrips some CSS
OutlookLimitedUse tables
Apple MailGoodFull support
MobileVariableKeep simple
---

8. Troubleshooting Tips

Common Issues

SymptomPossible CauseSolution
Variables not replacedWrong syntaxUse {{variable}}
HTML brokenExternal CSSUse inline styles
Email not sentTemplate inactiveEnable template
Blank emailMissing contentAdd HTML content

Test Template

  1. Edit template
  2. Save changes
  3. Trigger notification event
  4. Check recipient inbox
  5. Verify formatting

Check Template

Sql
SELECT 
  name,
  slug,
  subject,
  is_active,
  html_content
FROM public.email_templates
WHERE slug = 'new-voicemail';

---

9. Glossary

TermDefinition
TemplateReusable email layout
SlugUnique identifier
VariableDynamic placeholder
HTML ContentRich text version
Plain TextFallback text
OverrideReplace default
---

Lua Script Status ℹ️

Content Module

ComponentStatus
Email Templatesℹ️ Template management - no Lua handler required
Email Templates is a content management module. Templates are processed by the backend email service to replace variables and send notifications. No Lua handlers are used.

---

Documentation last updated: January 2026
AI Assistant

👋 Hello! I'm your Ring2All documentation assistant. I can help you find information about configuring and using the Ring2All PBX platform.

How can I help you today?