Email Signatures API
The Email Signatures API manages multilingual email signatures appended to outgoing ticket emails. Signatures are assigned per mailbox or fall back to a default signature, support inline images (CID-embedded) and variable placeholders.
🔐 Auth: Logged-in users only (cookie session); API keys are rejected. Rights via emailSignatures.*. See RBAC →.
Endpoints
| Method | Endpoint | Description | Permission |
|---|---|---|---|
GET | /api/email-signatures | List — { data, pagination } (pagination, search) | view |
GET | /api/email-signatures/:id | Single signature | view |
GET | /api/email-signatures/:id/preview | Rendered preview (query language?) | view |
POST | /api/email-signatures | Create (201) | create |
PUT | /api/email-signatures/:id | Update | edit |
DELETE | /api/email-signatures/:id | Soft-delete → 204 | delete |
POST | /api/email-signatures/:id/set-default | Set as default (the previous default is unset) → signature object | setDefault |
POST | /api/email-signatures/:id/activate | Activate → signature object | edit |
POST | /api/email-signatures/:id/deactivate | Deactivate → signature object | edit |
POST | /api/email-signatures/:id/test-email | Test email to own address (body language?) → { queued, recipient } | edit |
List query: page (default 1), limit (default 25, max 100), search, isActive (true/false). The mailbox assignment itself is done via the mailbox configuration (separate right emailSignatures.assignToMailbox).
- Unknown fields in the body are rejected with 400. The language parameters of preview and test email accept only the five system languages; the language keys inside translations stay deliberately free-form (2–5 chars), so existing data with additional languages is preserved.
- The test email requires an active email channel — if sending is globally disabled or under maintenance, the route answers 400 EMAIL_SYSTEM_DISABLED instead of putting a mail into a halted queue. Sending itself is asynchronous; { queued: true } means "accepted", not "delivered".
Create Signature
POST /api/email-signatures
{
"name": "Support-Team",
"isDefault": false,
"isActive": true,
"translations": {
"de": {
"html": "<p>Mit freundlichen Grüßen<br>{{agentName}} — {{companyName}}</p>",
"plainText": "Mit freundlichen Grüßen\n{{agentName}} — {{companyName}}"
},
"en": {
"html": "<p>Best regards<br>{{agentName}} — {{companyName}}</p>",
"plainText": "Best regards\n{{agentName}} — {{companyName}}"
}
}
}
translations is a record (at least one language, key 2–5 chars), each entry with html + plainText (both required). name 1–100 chars. Setting isDefault=true automatically unsets other defaults. The HTML is sanitized on save.
Placeholders (five, in html and plainText): {{agentName}}, {{agentEmail}}, {{agentPhone}}, {{companyName}} and {{appUrl}}. In a ticket reply, {{agentName}} and {{agentEmail}} stand for the name and email address of the replying agent; in system notifications {{agentName}} stands for the application name and {{agentEmail}} stays empty. {{companyName}} comes from the general settings, {{appUrl}} is the address of the application. The preview fills all five with sample data. Unknown placeholders remain as text; lines left empty by an empty value are dropped.
Resolution on Email Sending
When a ticket reply is sent, the matching signature is determined: first the one assigned to the mailbox, otherwise the default signature. Embedded images are sent as CID attachments with the email so they display without being loaded externally.
Permissions (emailSignatures)
| Permission | Description |
|---|---|
emailSignatures.view | List/details/preview |
emailSignatures.create | Create signature |
emailSignatures.edit | Edit, activate/deactivate, test email |
emailSignatures.delete | Delete (soft-delete) |
emailSignatures.setDefault | Set default signature |
emailSignatures.assignToMailbox | Assign signature to a mailbox (mailbox configuration) |
Email sending, mailboxes, CID inline images
Notification templates (separate from signatures)