Creating your own notification template
When Defthand’s ready-made notifications are not enough, you write your own template. Two places use your own templates: the rules on a form’s Notifications tab (who gets what when a form is submitted) and the notification step in workflows. This page explains how to create a template and then walks through an example end to end. For every editor button see Notification templates.
Creating templates needs the permission to manage notification templates. The screens are in Turkish only for now; Turkish labels are in parentheses.
The new template window
Section titled “The new template window”On Notification templates, click New template (“Yeni şablon”). The top of the window notes that the code is how the template is found when sending and cannot be changed later; you write the content on the next screen.
| Field | What you enter |
|---|---|
| Name (“Ad”, required) | The name in the list. For example Expense request received. |
| Code (“Kod”, required) | Lower-case letters, digits, dot, hyphen, underscore (for example order.confirmed). It is suggested from the name as you type; you can change it. It cannot change later. |
| Description (“Açıklama”) | Optional. A sentence on when the template is sent. People see it on the notification preferences screen. |
| Channel (“Kanal”) | E-mail, In-app, SMS, Push or Multi-channel (“Çok kanallı”). A multi-channel template has a separate text per channel. |
| Scope (“Kapsam”) | Custom (“Özel”), Form submission (“Form gönderimi”) or Workflow task (“Akış görevi”). Decides which variables are available and where the template can be chosen. |
| Default language (“Varsayılan dil”, required) | One of your organization’s languages. The template’s main language. |
| Layout | E-mail templates only. Default layout (“Varsayılan layout”) or a layout from the list. See E-mail layouts. |
| Linked form (“Bağlı form”) | With Form submission or Workflow task scope. The form’s questions are listed as form.* variables. Only published forms can be chosen. |
| Linked workflow (“Bağlı iş akışı”) | With Workflow task scope. The workflow’s details and variables are listed. |
Click Create (“Oluştur”): “Şablon oluşturuldu” (template created) appears and the editor opens. The template is a Draft; until you publish it, no rule can send it.
Scopes
Section titled “Scopes”| Scope | For | Extra variables |
|---|---|---|
| Custom | A general notification not tied to a form or workflow. | Organization, recipient, system |
| Form submission | Sent by a form’s notification rules when the form is submitted. | form.* (the linked form’s questions), submission.*, submitter.* |
| Workflow task | Sent by a workflow’s notification step. | workflow.*, instance.*, task.*, step.name, initiator.*, approver.name, decision, comment, vars.*; form.* when linked to a form |
Messages you may meet
Section titled “Messages you may meet”- If the Code breaks the rule, the window does not save: use only lower-case letters, digits,
.,-,_. - Prefixes reserved for Defthand’s own notifications are closed to organizations:
identity.,billing.,workflow.,notifications.,forms.,inspections.,tenants.,issues.,personnel.,training.,aiworkspace.. Use a prefix of your own (for exampleexpense.,purchasing.). - Two templates cannot have the same code.
- If the Linked form list is empty or says the forms could not be listed (you may not have permission), you are not allowed to see forms or there is no published form yet.
Changing the linked form or workflow later
Section titled “Changing the linked form or workflow later”In the editor, click Edit details (“Bilgileri düzenle”). In the template details window you can change the Name, Description, Layout and links. To remove a link choose Not linked (“Bağlı değil”). “Şablon bilgileri kaydedildi” (details saved) appears.
Example: an “Expense request received” e-mail
Section titled “Example: an “Expense request received” e-mail”Scenario: employees send expense requests with the Expense Form. When the form is submitted you want an e-mail to the accounting team and
an in-app notification to the sender. The form has these questions: Expense type (key tur, choice), Amount (key tutar, number),
Expense date (key tarih, date), Description (key aciklama, text), Receipt (key fis, file).
1. Create the template
Section titled “1. Create the template”- Notification templates › New template.
- Name:
Masraf talebi alındı(Expense request received). - Code:
masraf.talep.alindi. - Description:
Sent to accounting and to the sender when the Expense Form is submitted. - Channel: Multi-channel.
- Scope: Form submission.
- Default language: Turkish.
- Layout: Default layout.
- Linked form: Expense Form.
- Create.
2. Write the e-mail text
Section titled “2. Write the e-mail text”-
Choose the E-mail tab and the Turkish language (the default; the English text comes in step 4).
-
Subject:
Yeni masraf talebi: {{ submitter.name }} – {{ form.tutar | currency: "TRY" }} -
Preheader:
{{ form.tur }} · {{ form.tarih }} -
HTML body:
<h2>Yeni masraf talebi</h2><p>{{ submitter.name }}, {{ submission.submitted_at | local_date: "dd.MM.yyyy HH:mm" }} tarihinde bir masraf talebi gönderdi.</p><table><tr><td>Masraf türü</td><td>{{ form.tur }}</td></tr><tr><td>Tutar</td><td>{{ form.tutar | currency: "TRY" }}</td></tr><tr><td>Masraf tarihi</td><td>{{ form.tarih }}</td></tr><tr><td>Açıklama</td><td>{{ form.aciklama }}</td></tr><tr><td>Fiş</td><td>{{ form.fis }}</td></tr></table>{% if form.tutar > 5000 %}<p><strong>Bu talep 5.000 TL'yi aşıyor; yönetici onayı gerekir.</strong></p>{% endif %}<p><a href="{{ submission.url }}">Talebi Defthand'de açın</a></p> -
Save draft. If Diagnostics is empty or shows only warnings, the save is fine.
-
Check the table in the Preview. To change the sample values use Sample data (JSON).
-
Send it to yourself with Send test e-mail.
3. Write the in-app text
Section titled “3. Write the in-app text”- Go to the In-app tab.
- Title:
Masraf talebiniz alındı - Text:
{{ form.tutar | currency: "TRY" }} tutarındaki {{ form.tur }} talebiniz muhasebeye iletildi. - Link:
/forms/submissions/{{ submission.id }} - Save draft.
4. English text
Section titled “4. English text”If English is on in your organization, write both channels’ translations on the English tab, or have an AI tool translate them with Copy translation prompt (“Çeviri komutu kopyala”). Without English text, people who use English get the default language (Turkish). See Template translations.
5. Publish
Section titled “5. Publish”Publish › see both channels’ changes in the window › Publish. The template becomes Published · v1.
6. Connect it to the form
Section titled “6. Connect it to the form”On the Expense Form’s Notifications tab, add two rules: one whose recipient is the accounting group and channel E-mail, and one whose
recipient is the person who submitted the form and channel In-app; both use the template masraf.talep.alindi. Rule details:
Forms.
To send from inside a workflow, write a template with Workflow task scope and choose it in the workflow’s notification step: Workflows.
Deleting
Section titled “Deleting”You delete your own template in the editor with Delete template (“Şablonu sil”); it asks for confirmation. A template with messages waiting to be sent cannot be deleted. The record of messages already sent stays in the delivery log. Before deleting a template used in a form rule or a workflow, take it out there.