{% extends "base.html" %} {% load static %} {% block title %}{% if object %}Edit Template{% else %}Create Template{% endif %} - Communications{% endblock %} {% block content %}

{% if object %}Edit Template{% else %}Create Template{% endif %}

{% csrf_token %}
Template Details
{{ form.template_name }} {% if form.template_name.errors %}
{{ form.template_name.errors.0 }}
{% endif %}
Enter a unique, descriptive name for this template
{{ form.category }} {% if form.category.errors %}
{{ form.category.errors.0 }}
{% endif %}
{{ form.message_type }} {% if form.message_type.errors %}
{{ form.message_type.errors.0 }}
{% endif %}
{{ form.description }} {% if form.description.errors %}
{{ form.description.errors.0 }}
{% endif %}
Describe the purpose and usage of this template
{{ form.language }} {% if form.language.errors %}
{{ form.language.errors.0 }}
{% endif %}
Select the primary language for this template
{{ form.subject_template }} {% if form.subject_template.errors %}
{{ form.subject_template.errors.0 }}
{% endif %}
Use variables like {patient_name}, {appointment_date} 0 characters
{{ form.body_template }} {% if form.body_template.errors %}
{{ form.body_template.errors.0 }}
{% endif %}
Enter the main content template with variables 0 characters
{{ form.is_active }}
{% if form.is_active.errors %}
{{ form.is_active.errors.0 }}
{% endif %}
Only active templates can be used for sending messages
Template Variables
Define variables that can be used in your template. Variables should be referenced as {variable_name} in the template content.
Live Preview
Template Preview:
Subject:
[Subject will appear here]
Body:
[Body will appear here]
Sample Data:
Actions


Cancel
Help & Variables

{patient_name} - Full patient name
{patient_first_name} - First name only
{patient_id} - Patient ID number
{patient_phone} - Phone number
{patient_email} - Email address
{patient_dob} - Date of birth

{appointment_date} - Appointment date
{appointment_time} - Appointment time
{provider_name} - Healthcare provider
{department} - Department name
{location} - Appointment location
{appointment_type} - Type of appointment

{hospital_name} - Hospital name
{hospital_phone} - Hospital phone
{hospital_address} - Hospital address
{current_date} - Current date
{current_time} - Current time
{system_url} - System URL

• Use clear, descriptive template names
• Keep subject lines concise and informative
• Test templates before activating
• Use appropriate variables for personalization
• Consider different message types (SMS vs Email)
• Include fallback text for missing variables
Quick Insert
{% endblock %} {% block js %} {% endblock %}