Skip to content
Nederlands

Email Templates

CSDesk sends various automated emails using customizable templates. Each template has a subject line, HTML body, and plain text body with dynamic placeholders for ticket and user data.

Access: Settings → Email → Email templates
Route: /admin/email-templates
Permissions: Admin only

The Settings hub is accessible via the gear icon in the navigation rail.

CSDesk includes 9 seeded email templates:

Template Purpose Sent To When
requester_first_invite First-time requester sign-in link New requester When an account is created with an invitation
requester_magic_link Requester sign-in link Existing requester When they request magic link
staff_first_invite First-time staff sign-in link New agent/admin When an account is created with an invitation
staff_magic_link Staff sign-in link Existing agent/admin When they request magic link
new_ticket_agent New ticket alert Selected agents When ticket created (if configured under New-ticket alerts)
ticket_create_rejected Ticket creation rejected Sender with can_create_tickets = false When they email support
ticket_email_creation_disabled Email intake disabled Email sender When an email would create a new ticket while email ticket creation is off
ticket_archived_reply Reply to archived ticket Email sender When they reply to archived ticket by email and email creation is disabled
ticket_received Ticket received acknowledgement Email sender When ticket created from email (if enabled)

The editor shows each template by its display name, e.g. “Ticket Received Acknowledgement (Sender)”.

  1. Go to Settings → Email → Email templates (/admin/email-templates)
  2. Click Edit on the template you want to customize
  • Type: Plain text with placeholders
  • Example: Your ticket has been received
  • Placeholders: Replaced at send time with actual data
  • Type: HTML
  • Editor: Text field for the HTML source (no WYSIWYG)
  • Purpose: Formatted email for modern email clients
  • Placeholders: Use {{ placeholder_name }} syntax
  • Type: Plain text with placeholders
  • Purpose: Fallback for email clients that don’t support HTML
  • Best practice: Always provide plain text version
  1. Edit subject, HTML body, and/or plain text body
  2. Click Save Template
  3. Changes apply immediately to new emails

Placeholders vary by template; the editor lists the ones allowed for each template. Common placeholders:

Placeholder Description Example
{{ user_name }} User’s full name John Smith
{{ user_email }} User’s email address john@example.com
{{ requester_name }} Requester’s name (new ticket alert) Jane Doe
{{ requester_email }} Requester’s email (new ticket alert) jane@example.com
Placeholder Description Example
{{ ticket_reference }} Ticket reference number CSD-1234
{{ ticket_subject }} Ticket subject line (new ticket alert) Login issue
{{ ticket_url }} Link to the ticket in the desk (new ticket alert) https://...
{{ ticket_channel }} How ticket was created (new ticket alert) email
{{ original_subject }} Subject of the sender’s email (rejections, acknowledgement) Help needed
Placeholder Description Example
{{ organization_name }} Organization name Acme Corp
Placeholder Description Example
{{ app_name }} Application name CSDESK
{{ support_email }} Support email address (rejections, acknowledgement) support@example.com
{{ login_url }} Magic link URL (sign-in templates) https://.../login/t/...
{{ expires_minutes }} Magic link expiry in minutes (sign-in templates) 20
{{ expires_at }} Magic link expiry time (sign-in templates)
{{ user_role }} Role of the user (sign-in templates) requester
{{ portal_url }} Customer portal home (rejection notices) https://.../portal

Not all placeholders are available in all templates. Saving a template that uses a placeholder not allowed for it is rejected. Allowed placeholders without a value render as empty text.

Subject:

Your CSDESK sign-in link

HTML Body:

<p>Hello {{ user_name }},</p>
<p>Click the link below to sign in to {{ app_name }}:</p>
<p><a href="{{ login_url }}">Sign in to CSDESK</a></p>
<p>This link expires in {{ expires_minutes }} minutes and can only be used once.</p>
<p>If you didn't request this, you can safely ignore this email.</p>
<p>Thanks,<br>
The CSDESK Team</p>

Plain Text Body:

Hello {{ user_name }},
Click the link below to sign in to {{ app_name }}:
{{ login_url }}
This link expires in {{ expires_minutes }} minutes and can only be used once.
If you didn't request this, you can safely ignore this email.
Thanks,
The CSDESK Team

Subject:

Your ticket has been received

HTML Body:

<p>Hello {{ user_name }},</p>
<p>Thank you for contacting us. We have created ticket <strong>{{ ticket_reference }}</strong> for your request:</p>
<p>{{ original_subject }}</p>
<p>Our team will review your ticket and respond as soon as possible. You can reply to this email to add more information to the ticket.</p>
<p>This is an automated acknowledgement from {{ app_name }} ({{ support_email }}).</p>

Subject:

New ticket: {{ ticket_subject }}

HTML Body:

<p>A new ticket has been created:</p>
<p><strong>Reference:</strong> {{ ticket_reference }}<br>
<strong>Subject:</strong> {{ ticket_subject }}<br>
<strong>Requester:</strong> {{ requester_name }} ({{ requester_email }})<br>
<strong>Organization:</strong> {{ organization_name }}</p>
<p><a href="{{ ticket_url }}">View Ticket</a></p>
  1. Edit template
  2. Click Preview button
  3. The rendered template is shown with sample data, including your unsaved edits
  4. Check formatting and placeholder replacement

Note: Preview uses sample data, not real ticket/user data.

  1. Edit and save the template
  2. Click Send Test Email to Me
  3. Email sent to your own address, rendered with sample data
  4. Check inbox for actual rendered email

Best practice: Always send test email before deploying changes to production.

Only the four sign-in templates (first invite and sign-in link, for requesters and staff) have a required placeholder:

  • Magic link templates: Must include {{ login_url }} in both the HTML and the plain text body

Validation: Checked on save. A missing {{ login_url }} or a placeholder that is not allowed for the template causes a save error. The subject is limited to 255 characters.

HTML bodies are sanitized on save, and again when an email is rendered:

  • Dangerous tags and attributes removed
  • Safe HTML formatting preserved (<p>, <a>, <strong>, <em>, <br>, tables)
  • Test thoroughly in multiple email clients
  • Be descriptive: Recipients should know what the email is about
  • Use placeholders: Include ticket reference or user name for context
  • Keep short: < 60 characters ideal for mobile preview
  • Use inline CSS: Email clients often strip <style> tags
  • Keep formatting simple: Tables and inline styles work best
  • Test in multiple clients: Gmail, Outlook, Apple Mail
  • Responsive design: Use max-width for mobile compatibility

Example inline style:

<p style="color: #333; font-family: Arial, sans-serif; font-size: 14px;">
Hello {{ user_name }},
</p>
  • Always provide: Required for accessibility and text-only clients
  • Match HTML content: Should convey same information
  • Use line breaks: Keep lines < 78 characters
  • No formatting: No bold, italic, links are plain text
  • Test all placeholders: Ensure they render correctly
  • Handle missing data: Some placeholders may be empty (e.g., organization_name for unmatched senders)
  • Don’t over-use: Too many placeholders can make templates hard to maintain

CSDesk does not have built-in multi-language support for templates:

  • Templates are in one language (English by default)
  • If you have multilingual customers, consider:
    • Keeping language simple and clear
    • Using international date/time formats
    • Avoiding idioms or colloquialisms

Some templates have rate limiting:

ticket_create_rejected, ticket_email_creation_disabled and ticket_archived_reply:

  • Limit: Once per sender per calendar day, shared by all three
  • Purpose: Prevent reply loops and spam
  • Stored in: ticket_create_rejections table

Magic links:

  • Limit: 6 per email per hour
  • Cooldown: 120 seconds server-side between requests
  • Purpose: Prevent abuse

Check:

  1. Is placeholder name correct? (case-sensitive, exact match)
  2. Is placeholder supported in this template?
  3. Is data available? (e.g., organization_name empty for unmatched senders)

Solution: Review available placeholders list and test with send test email.

Common issues:

  1. Broken layout: Use inline CSS, avoid external stylesheets
  2. Images not showing: Use absolute URLs for images
  3. Links not working: Ensure URLs are complete (include https://)

Solution: Test in multiple email clients, simplify HTML.

Cause: Most email clients prefer HTML when both are provided

Solution: This is expected behavior. Plain text is fallback only.

Check:

  1. Did you click Save Template?
  2. Did the save show an error (for example a placeholder that is not allowed)?
  3. Check logs for errors during send

Solution: Clear browser cache, send test email again.

Table: email_templates

Columns:

  • key (unique identifier, e.g., requester_magic_link)
  • name (display name)
  • subject
  • body_html
  • body_text
  • updated_by (last editor)
  • created_at, updated_at

Seeding: Templates are seeded via EmailTemplateSeeder on installation.

Back to Documentation