Notification templates
The text of every notification Defthand sends comes from a template. This page covers the template screens and the editor end to end. To write your own template from scratch see Creating your own notification template; for translation see Template translations; for the e-mail frame see E-mail layouts.
Who uses it
Section titled “Who uses it”In the administration menu, under Notifications, you find Notification templates and Email layouts. These menus show only to people allowed to view notification templates. Viewing opens the screens read-only; saving drafts, publishing, creating and deleting templates needs the permission to manage templates as well. Your organization’s administrator gives roles: Administration.
Main ideas
Section titled “Main ideas”- Code: the template’s fixed identity (for example
order.confirmed). Forms and workflows find the template by this code. - Source: System (“Sistem”, a Defthand ready-made template) or Tenant (“Tenant”, your organization’s own template).
- Channel variant: a template has a separate text for each channel (E-mail, In-app, SMS, Push) and each language.
- Draft and publish: the text you edit is first saved as a draft. Recipients always get the last published version. Publishing copies all drafts into a new version that cannot be changed (v1, v2…).
- Default language: the template’s main language. Publishing needs a draft in it. The other languages are its translations.
The template list
Section titled “The template list”The Notification templates page shows all your organization’s templates in a paged table.
| Column | What it shows |
|---|---|
| Template (“Şablon”) | The template’s name with its code below |
| Channel (“Kanal”) | One channel, or Multi-channel (“Çok kanallı”) |
| Source (“Kaynak”) | System or Tenant; on a system template you changed, also Customized (“Özelleştirildi”) |
| Status (“Durum”) | Draft (“Taslak”) or Published (“Yayında”) with the version, such as “Yayında · v3”; with an unpublished draft, also Unpublished change (“Yayınlanmamış değişiklik”) |
| Languages | The languages the template has text in |
| Last change (“Son değişiklik”) | When it was last changed |
To narrow the list:
- type in the search box (search by code or name, “Kod veya ada göre ara…”);
- pick a Channel filter: All (“Tümü”), E-mail (“E-posta”), In-app (“Uygulama içi”), SMS or Push (“Anlık bildirim”);
- pick a Source filter: All, System or Tenant;
- pick a Status filter: All, Draft or Published.
If nothing matches, the page says no template was found. Click a row to open the template editor. For a new template use New template (“Yeni şablon”).
The template editor
Section titled “The template editor”The editor’s top bar shows the template’s name, code and status, with these buttons on the right:
| Button | What it does |
|---|---|
| Edit details (“Bilgileri düzenle”) | Opens the template details window: Name (“Ad”), Description (“Açıklama”), Layout for templates with e-mail, and for your own templates the linked form and linked workflow. |
| Version history (“Sürüm geçmişi”) | Shows the published versions, read-only. |
| Translations (“Çeviriler”) | The translation file menu: Template translations. |
| Back to default (“Varsayılana dön”) | System templates only: publishes Defthand’s original text as a new version. |
| Delete template (“Şablonu sil”) | Your own templates only. |
| Publish (“Yayınla”) | Publishes the drafts as a new version. |
Below are three areas: the content on the left, the Variables (“Değişkenler”) panel on the right, and the Preview (“Önizleme”).
Channel and language tabs
Section titled “Channel and language tabs”- The channel tabs show the template’s channels: E-mail, In-app, SMS, Push. A single-channel template has one tab.
- The language tabs are the languages turned on in your organization’s Settings › Languages. The default language is marked. A tab with unsaved changes shows an Unsaved (“Kaydedilmemiş”) mark. A translation that fell behind the default language shows “güncel değil” (out of date).
The line under the tabs names the selected language (“— varsayılan dil” for the default) and the translation’s state. When a non-default language has a draft, two small buttons appear on that line:
- Change the default language (“Varsayılan dili değiştir”): after you confirm (Make default, “Varsayılan yap”), this language becomes the template’s default language. When there is no text in a recipient’s language, this language is sent. Every channel that has a draft must also have a draft in this language.
- Remove the language draft (“Dil taslağını kaldır”): deletes the draft for this channel and language. Published versions are not affected.
Fields by channel
Section titled “Fields by channel”- Subject (“Konu”, required, one line). For example
Your order was received, {{ recipient.first_name }}. - Preheader (“Ön metin”): the short summary shown next to the subject in the inbox.
- HTML body (“HTML gövde”): the e-mail’s HTML. The code editor shows line numbers and error marks.
- After saving, Generated plain text (“Üretilen düz metin”) shows the plain-text version that mail programs without HTML use.
In-app and Push
- Title (“Başlık”): the notification’s bold line (one line).
- Text (“Metin”): a short description.
- Link (“Bağlantı”): the address opened when the notification is clicked; variables are allowed. For example
/forms/submissions/{{ submission.id }}. It must be a page inside Defthand and start with/. - The Push tab shows a card below the text with how the notification looks on a phone or in a browser.
SMS
- SMS text (“SMS metni”): plain text;
{{ variable }}is allowed. The preview shows how many parts the SMS splits into. Turkish letters (ç ğ ı İ ş) lower how many characters fit in one part.
Variables
Section titled “Variables”The Variables panel on the right lists every variable the template can use, in groups. Search with the variable search box; click a
variable to insert it as {{ name }} where your cursor is (in the subject field or the code editor).
| Group | Examples |
|---|---|
| Organization | {{ tenant.name }}, {{ tenant.logo_url }}, {{ tenant.brand_color }} |
| Recipient | {{ recipient.name }}, {{ recipient.first_name }}, {{ recipient.last_name }}, {{ recipient.email }} |
| System | {{ system.now }}, {{ system.year }}, {{ system.app_url }} |
| Form: {form name} | Each question of the linked form: {{ form.amount }} |
| Submission | {{ submission.url }}, {{ submission.submitted_at }}, {{ submitter.name }} |
| Workflow | {{ workflow.name }}, {{ task.name }}, {{ task.url }}, {{ task.due_at }}, {{ approver.name }}, {{ decision }}, {{ comment }} |
| Workflow variables | The linked workflow’s variables: {{ vars.amount }} |
Which groups appear depends on the template’s scope and the form or workflow it is linked to.
Values are written for the recipient: dates and times in the recipient’s time zone, numbers in the format of the recipient’s language
(1250.5), yes/no questions as “Yes” / “No”, choice questions with the option’s name in the recipient’s language. Use filters to format:
{{ task.due_at | local_date: "dd.MM.yyyy HH:mm" }}, {{ form.amount | currency: "TRY" }}, {{ recipient.first_name | upcase }}.
You can also write conditions: {% if form.amount > 5000 %}This request needs manager approval.{% endif %}.
Saving and diagnostics
Section titled “Saving and diagnostics”- Save draft (“Taslağı kaydet”, or Ctrl/Cmd+S) saves only the draft of the open channel and language. “Taslak kaydedildi” (draft saved) appears.
- The text is checked when you save. Problems are listed under the content as Diagnostics (“Tanılar”):
- An Error (“Hata”) stops the save: a required field is empty (“Konu zorunludur.” — the subject is required), the variable syntax is wrong, a one-line field has a line break, or a tag that is not allowed was used. The error shows its line and column.
- A Warning (“Uyarı”) does not stop the save (the draft is saved with warnings): an unknown variable (left empty when sending) or an HTML/CSS rule removed for safety.
- If you try to leave the page with unsaved changes, the screen warns you that unsaved draft changes will be lost.
Preview
Section titled “Preview”The Preview updates when you stop typing, even with unsaved text (a note says the live preview shows unsaved changes). The preview is drawn the same way as a real send, inside the selected layout.
- The Desktop / Mobile buttons (“Masaüstü” / “Mobil”) show the e-mail wide or at phone width.
- Refresh preview (“Önizlemeyi yenile”) draws it again.
- In Sample data (JSON) (“Örnek veri (JSON)”) you can change the sample values used by the preview; the sample data must be a JSON
object (
{ "amount": 7500 }). - Your organization’s name, logo and brand colour show in the preview with their real values.
Test e-mail
Section titled “Test e-mail”On the e-mail channel, Send test e-mail (“Test e-postası gönder”) sends the draft only to your own e-mail address, with your organization’s
e-mail settings. The subject starts with [Test]. The result shows on screen as sent, or as not sent with the reason. Save first: unsaved text
is not tested.
Publishing
Section titled “Publishing”- Click Publish. The Publish template (“Şablonu yayınla”) window opens.
- The window lists which channels and languages go into the new version and what changed. All drafts are copied into a new, unchangeable version (for example v4); sends from then on use this version.
- If there are unsaved changes the button becomes Save and publish (“Kaydet ve yayınla”): it saves first and does not publish if a save fails.
- Confirm with Publish.
Publishing does not happen when:
- there is no draft to publish (“Yayınlanacak taslak yok.”);
- there is no draft in the default language;
- a draft is in a language that is no longer on in your organization: remove that language’s draft or turn the language back on.
Out-of-date translations do not stop publishing; the window lists them and you can publish anyway.
Version history
Section titled “Version history”Version history lists every published version; the one in use is marked Current (“Güncel”). Selecting a version shows its channels and languages, the Subject / Title lines, a preview and the read-only source HTML (“Kaynak (salt okunur)”). If nothing was published yet it says so. To bring back an old version, copy its text and publish it as a new draft.
Ready-made (system) templates
Section titled “Ready-made (system) templates”Defthand’s own notifications are system templates: approval task assigned, task returned, task reminder, training assigned, exam result, inspection assigned, corrective action overdue, password reset, invitation and more. Each comes with Turkish and English text.
- The name, description, layout and text can be changed. When you change the text, the list shows Customized.
- The code, the scope and the channels it can be sent on cannot be changed; a system template cannot be deleted.
- Back to default publishes Defthand’s original text as a new version; your versions stay in the history.
- When Defthand improves a ready-made text in a new release, templates you did not customize are updated by themselves; customized ones are left alone.
- Critical templates (for example password reset, invitation) cannot be turned off in user preferences.
Example: adding a company note to the approval task e-mail
Section titled “Example: adding a company note to the approval task e-mail”- In Notification templates, set the Source filter to System and type
task.assignedin the search box. - Open the task assigned template, choose the E-mail tab and the English language.
- In the HTML body, add this paragraph below the button:
<p>Please complete your approvals within two working days. {{ tenant.name }} Purchasing</p> - Click Save draft and see the paragraph in the Preview.
- Send it to yourself with Send test e-mail and check it in your mail program.
- On the Turkish tab, add the same paragraph in Turkish and save.
- Publish › Publish. In the list the template now shows as Customized with the new version number.