---
title: Creating an Automated Email – When a Record is Deleted (Trigger)
description: "This article shows you how to build a trigger that sends an email when a record is deleted (retracted), including who deleted it. > **Applies to:** System administrators (`admin` role) · **Module:** Set up > Triggers ## Before you start…"
url: "https://support.symbiant.co.uk/kb/creating-a-delete-trigger/"
updated: "2026-10-30"
category: Automated Emails (Task Based)
tags:
  - Add
  - Delete
  - Triggers
---

# Creating an Automated Email – When a Record is Deleted (Trigger)

This article shows you how to build a trigger that sends an email when a record is deleted (retracted), including who deleted it.

> **Applies to:** System administrators (`admin` role) · **Module:** Set up > Triggers

## Before you start

Shipped triggers such as `register-risks-risk-deleted-generic` arrive inactive and may only need activating.

## Accessing Triggers

1. Click the **Set up** spanner at the bottom left of the screen.
   ![The Set up spanner at the bottom left](https://support.symbiant.co.uk/wp-content/uploads/2026/10/kb-common-setup-spanner-c03de5.png)
2. In the Set up menu, under **Events**, click **Triggers**.
   ![Triggers in the Set up menu](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-triggers-menu-e18237.png)
3. Click the **+** icon at the top right.
   ![The plus icon](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-add-plus-4d53a9.png)

## Trigger Details

1. In **Resource**, choose the module the email is about, for example **Register-Risks**. Type to search the list.
   ![Choosing the Resource](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-new-resource-160fdb.png)
2. In **Operation**, choose **Delete**.
   ![Choosing the Operation](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-new-operation-fbae3a.png)
3. In **Name**, enter a name with no spaces, for example `register-risks-risk-deleted-company`. A good convention is module, what happens, then your company name.
   ![Naming the trigger](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-new-name-264e70.png)
4. Leave **Active?** unticked while you build and test. See [Activating and Deactivating an Automated Email](https://support.symbiant.co.uk/kb/activating-and-deactivating-an-automated-email/).

## Trigger Assignment

**Assignments (who can cause this trigger to fire)** controls whose actions fire the trigger. It is not the list of people who receive the email.

1. Tick the users, roles and/or divisions whose changes should fire it. To cover everyone, tick the root division (for example **Company**): every user sits in it or a division below it.
   ![Assigning the trigger to the root division](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-new-assignment-d32bd6.png)

## The Function Chain

The **ƒ chain** panel on the right holds the steps (interceptors) the trigger runs, from top to bottom. Each interceptor can use the output of the ones above it through its **Data source**.

1. To add an interceptor, click the **+** at the top of the **ƒ chain** panel and pick it from the list. It is added at the bottom of the chain.
   ![Adding an interceptor to the function chain](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-chain-add-2be070.png)
2. To remove one, click the **−** at the top right of its card.

## Adding the tx-entity Interceptor

1. Add a **tx-entity** interceptor.
2. Choose **Before change**: after a delete there is no record left to load, so load it as it was before.
   ![tx-entity loading the record before the change](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-txentity-before-3a7101.png)

## Adding the Manager Interceptor (Optional)

Use a **manager** interceptor when the email should go to users with a particular role, such as the module admins. Emails to the record's owners, creator or assignees don't need one.

1. Add a **manager** interceptor.
2. **Data source**: the interceptor above it (here **tx-entity**).
3. **Attribute**: the user field to look through, usually **generic/owners**.
4. **Role**: the role to send to, for example **risk_admin**. Add one manager interceptor per role.
   ![The manager interceptor](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-manager-8ab74d.png)

> **Critical:** Don't choose the plain `admin` role. Choose the module role (for example `risk_admin`) and give that role to any admins who should get the email. See [How to Receive Module Specific Emails as System Admin](https://support.symbiant.co.uk/kb/how-to-receive-module-specific-emails-as-system-admin/).

## Adding the tx-user Interceptor

The **tx-user** interceptor collects the user who made the change, so the email can say who deleted the record.

1. Add a **tx-user** interceptor.
   ![The tx-user interceptor](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-txuser-0ec513.png)
2. In the template, use `{{<tx-user}}{{sm.user/name}}{{>tx-user}}` for their name and `{{<tx-user}}{{sm.user/email}}{{>tx-user}}` for their email.
   ![A delete template showing who deleted the record](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-template-delete-fbcb5c.png)

## Adding the Template Interceptor

The template is the email itself: who it is from and to, the subject and the body.

1. Add a **template** interceptor.
2. Write the email in **Content** in this order: `From:`, `To:`, optional `Cc:` and `Bcc:`, `Subject:`, a blank line, then the body.
   ![A template interceptor](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-template-d2d1af.png)
3. For **From:**, use the no-reply address shown in the shipped templates (`no-reply@symbiant.co.uk`) rather than a person's address.
4. For **To:** and **Cc:**, use user names, email addresses, or recipient codes. The table below lists the common codes.

| Send to | Code |
| --- | --- |
| Record owners | `{{<generic/owners}}{{sm.user/name}}, {{>generic/owners}}` |
| Record creator | `{{<created/user}}{{sm.user/name}}, {{>created/user}}` |
| Last person to change the record | `{{<modified/user}}{{sm.user/name}}, {{>modified/user}}` |
| Users with the manager interceptor's role | `{{<generic/owners}}{{<manager}}{{sm.user/name}}, {{>manager}}{{>generic/owners}}` |

The code works as a block: `{{<generic/owners}}` opens the Owners field, `{{sm.user/name}}` picks out each user, and `{{>generic/owners}}` closes the block. When a manager interceptor is used, wrap the whole content in `{{<manager}}` at the top and `{{>manager}}` at the bottom, as in the shipped templates.

1. Add record data to the subject or body with markers such as `{{risk/reference}}` and `{{generic/summary}}`. Click **template patterns...** above the content, then the **Text Markers** tab, for the marker syntax.
   ![Text Markers in template patterns](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-text-markers-a5ac43.png)
2. Click **validate template** to check the template before saving.

> **Note:** Field keys such as `risk/reference` are the same keys shown in the tx-check **Contains?** list and in Set up > Translators.

## Adding the Email Interceptor

1. Add an **email** interceptor.
2. In **Send Email**, choose your template.
3. In **Send as**, choose **HTML** (lets you use `<br/>` for line breaks and `<b>text</b>` for bold) or plain text.
   ![The email interceptor](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-email-b1ea7b.png)

## Adding the Log Interceptor

1. Add a **log** interceptor, set **Log** to **Emails**, enter a **Log Group** (for example `Register-Risks`) and choose your template in **Info line template**.
   ![The log interceptor](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-log-f2dc69.png)

> **Critical:** Don't use spaces in the Log Group name. Use dashes instead.

Sent emails then appear in Set up > **Log viewer** under that group.

## Saving and Testing

1. Click **Save** at the top right.
   ![The Save button](https://support.symbiant.co.uk/wp-content/uploads/2026/10/translators-save-f3437f.png)
2. Tick **Active?** and save again when you're ready to test (see [Activating and Deactivating an Automated Email](https://support.symbiant.co.uk/kb/activating-and-deactivating-an-automated-email/)).
3. Delete a test record in the module. You can restore it afterwards with ⋮ > Restore.
4. Check Set up > **Log viewer** for the log entry.
   ![The Log viewer](https://support.symbiant.co.uk/wp-content/uploads/2026/10/em-log-viewer-df174a.png)

> **Critical:** An active trigger sends real emails to real users. Test with a test record, and check the recipients before activating.

## Related articles

- [Creating an Automated Email – When a Record is Created (Trigger)](https://support.symbiant.co.uk/kb/creating-a-trigger/)
- [Creating an Automated Email – When a Record is Updated (Trigger)](https://support.symbiant.co.uk/kb/creating-an-update-trigger/)
- [How Automated Emails Work (Triggers and Schedules)](https://support.symbiant.co.uk/kb/how-automated-emails-work/)
