Skip to main content

Overview

The Templates module allows you to create, organize, and quickly access pre-written message templates. This guide covers everything you need to know about working with templates.

Understanding Template Types

The system supports two types of templates:

Predefined Templates

Type 1: System-wide templates available to all users. These are pre-configured and cannot be deleted by regular users.

Custom Templates

Type 2: User-created templates. You can create, edit, and delete your own custom templates.

Creating a New Template

1

Open Creation Modal

Click the “Create New Template” button to open the template creation form.
2

Enter Template Name

Type a unique name for your template. The system validates in real-time:
  • ✅ Shows “Nombre válido” if the name is available
  • ❌ Shows error if name already exists or contains invalid characters
Template names must be unique across all templates in the system.
3

Configure Opening Message

Enter the opening message content in the “Apertura” field. This is the message shown when the interaction starts.You can include:
  • Formatted text
  • Line breaks
  • Special characters
4

Configure Closing Message

Enter the closing message content in the “Cierre” field. This is the message shown when concluding the interaction.
5

Select a Color (Optional)

Choose a color to visually identify your template:
  • Blue, Green, Red, Purple
  • Yellow, Pink, Cyan, Orange
Colors help you quickly identify templates in the list.
6

Save Template

Click “Crear Plantilla” to save. The system will:
  • Validate the template name
  • Save to Firebase under Plantillas/
  • Add your username as the creator
  • Update local cache
  • Refresh the templates list

Using Templates

Opening a Template

1

Find Your Template

Browse or search for the template you need in the templates list.
2

Click to Open

Click on the template card to open the detail modal.
3

View Content

The modal displays:
  • Template name
  • Opening message with automatic greeting
  • Closing message with automatic greeting
The system automatically adds context-aware greetings:
var currentHour = new Date().getHours();
if (currentHour < 12) {
    saludo = "Buenos días";
} else if (currentHour < 18) {
    saludo = "Buenas tardes";
} else {
    saludo = "Buenas noches";
}

Copying Template Text

1

Open Template

Click on a template to open the detail view.
2

Copy Opening or Closing

Click either:
  • “Copiar texto” under the Opening section
  • “Copiar texto” under the Closing section
3

Paste into Your Application

The formatted text is now in your clipboard, ready to paste into:
  • Email clients
  • Chat applications
  • CRM systems
  • Any other text field
If you enable the clipboard timer (via the toggle switch), copied text automatically clears from your clipboard after 15 seconds for security.

Managing Templates

Editing a Template

1

Locate Your Template

Find a template you created (marked with your username).
2

Open Options Menu

Click the three-dot menu (⋮) in the top-right corner of the template card.
3

Select Edit

Click “✏️ Editar” from the dropdown menu.
4

Modify Content

Update any of the following:
  • Template name
  • Opening message
  • Closing message
  • Color
5

Save Changes

Click “Actualizar Plantilla” to save your changes.
If you change the template name, the old template is deleted and a new one is created with the new name.

Deleting a Template

1

Open Options Menu

Click the three-dot menu (⋮) on your template card.
2

Select Delete

Click ”❌ Eliminar” from the dropdown menu.
3

Confirm Deletion

Confirm the deletion when prompted.
Deletion is permanent and cannot be undone. The template is removed from Firebase immediately.
You can only edit or delete templates you created. Predefined templates and templates created by others are read-only.

Favorites System

Adding to Favorites

1

Find the Template

Locate any template you use frequently.
2

Click the Star

Click the ☆ (empty star) icon on the template card.
3

View in Favorites Section

The template now appears in the “Favoritos” section at the top of the page with a ★ (filled star) icon.

Removing from Favorites

1

Click the Star

Click the ★ (filled star) icon on any favorited template.
2

Confirm Removal

The template is removed from favorites but remains in the main templates list.
Favorites are saved per user in Preferencias/{username}/Favoritos and sync across all your sessions.

Color Customization

1

Click Color Picker

Click the 🔘 icon on any template card.
2

Select Color

Choose from the available color palette:
  • Blue: #3b82f6
  • Green: #10b981
  • Red: #ef4444
  • Purple: #a855f7
  • Yellow: #f59e0b
  • Pink: #ec4899
  • Cyan: #06b6d4
  • Orange: #f97316
3

Apply or Reset

  • Click a color to apply it immediately
  • Click “Restablecer color” to remove custom color
Colors are saved to local storage and persist across sessions.

Searching Templates

1

Enter Search Term

Type in the search box to filter templates by name.
2

View Results

Templates matching your search appear instantly.The search is case-insensitive and accent-insensitive:
function normalizarTexto(texto) {
    return texto.normalize("NFD")
        .replace(/[\u0300-\u036f]/g, "")
        .toLowerCase();
}
If enabled in preferences, you can search template content:
1

Enable Content Search

Check the preferences to enable searching within template content (opening and closing messages).
2

Search

Enter your search term. Results show:
  • Templates with matching names
  • Templates with matching content (marked with 📄 indicator)
3

Review Results

Content matches show a preview of the matching text with highlighting.
Content search can be slower for large template libraries. Enable it only if needed.

Filtering Templates

1

Open Filter Dropdown

Use the type filter dropdown to show specific template types.
2

Select Filter

Choose from:
  • All templates
  • Predefined only (Type 1)
  • Custom only (Type 2)
3

View Filtered Results

The list updates to show only templates matching your filter.

Exporting Templates

1

Click Export Button

Click “Exportar Todas” to export all templates to Excel.
2

Wait for Processing

The system generates an Excel file containing:
  • Template names
  • Type
  • Creator
  • Opening message (HTML stripped)
  • Closing message (HTML stripped)
3

Download File

The file downloads automatically as plantillas_export.xlsx.

Advanced Features

Template Caching

The system uses intelligent caching to improve performance:
  • Local Storage: Templates are cached in browser local storage
  • 5-Minute Validity: Cache refreshes every 5 minutes
  • Background Sync: Changes sync in real-time via Firebase listeners
If you don’t see recent changes, try refreshing the page to force a cache update.

Real-Time Collaboration

The system supports real-time updates:
// Firebase listeners detect changes automatically
db.ref('Plantillas').on('value', function (snapshot) {
    const nuevasPlantillas = snapshot.val() || {};
    if (JSON.stringify(nuevasPlantillas) !== JSON.stringify(plantillasCache)) {
        // Update cache and re-render
    }
});
  • Changes made by other users appear automatically
  • Your favorites sync across all your devices
  • No manual refresh needed

Current Duty Manager Display

The templates page includes a live display of the current duty manager:
1

Automatic Detection

The system:
  • Reads today’s schedules
  • Checks shift times
  • Determines who is currently on duty
2

Updates Every Minute

The duty manager display refreshes every 60 seconds to stay current.
3

Shows Shift Details

Displays:
  • Manager name
  • Shift code
  • Time range

Best Practices

Use Descriptive Names

Give templates clear, searchable names that describe their purpose.

Organize with Colors

Use colors to group related templates (e.g., all customer service templates in blue).

Favorite Your Most Used

Star frequently-used templates for quick access.

Keep Content Updated

Regularly review and update template content to ensure accuracy.

Troubleshooting

Solution: Check that:
  • The template name is unique
  • You have internet connectivity
  • The name doesn’t contain special characters
Look for validation messages below the name field.
Solution: You can only edit/delete templates you created. Check that:
  • The template shows your username as creator
  • You’re logged in with the correct account
  • The template is Type 2 (custom)
Solution: Favorites are stored per user. Ensure:
  • You’re logged in with the same account on all devices
  • Firebase has connectivity
  • Local storage is enabled in your browser
Solution: The system strips HTML tags when copying. If you need formatted text:
  • Copy manually from the preview
  • Or paste into a rich text editor that preserves formatting

Managing Schedules

Learn about shift scheduling

Working with Procedures

Access documented procedures

Build docs developers (and LLMs) love