> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/membership/triggers/edit.md).

# Edit a trigger

Edit a membership trigger — change the event, the action, the recipients and the template tokens.

**Where:** Membership → Triggers → click a trigger · `/projects/<project>/membership/triggers/<triggerId>/edit`

## Before you start

* The trigger exists — see [Create a trigger](/codemash/cloud/membership/triggers/new.md).
* You need the `membership:update` permission on triggers.

## Steps

1. In **Membership Triggers**, click the name, for example `Tell the team about sign-ups`. The form opens as **Edit Trigger** with the trigger id (`trg_EtUchJINUd4v8vRae4U4s`, with a copy button) and the **Actions** menu. Every saved value is loaded: the event, the action, the recipients, the template and the tokens.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-3f76342a21e1f9b269a51c4abac7ee88f575e32b%2Ftriggers-edit-1.png?alt=media" alt="Edit Trigger with the id trg_EtUchJINUd4v8vRae4U4s, the Actions button and the event When registered picked"><figcaption><p>Edit Trigger.</p></figcaption></figure>
2. Change what you need — the same fields as in [Create a trigger](/codemash/cloud/membership/triggers/new.md):

   | Part                                 | What you change                                                   | Example                                 |
   | ------------------------------------ | ----------------------------------------------------------------- | --------------------------------------- |
   | If this                              | The event.                                                        | **When registered**                     |
   | ... then                             | The action and its recipients.                                    | **Email Addresses**, `team@example.com` |
   | Template Details                     | The template and the language.                                    | `New sign-up`                           |
   | Template Tokens                      | The value of each token: type it, or pick it with the tag button. | `Recipient.FirstName` = `Team`          |
   | Order, Name the trigger, Description | The trigger's own fields.                                         | Order `1`                               |

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-66f795a2af281e42e4e393325c793d439987ddea%2Ftriggers-edit-2.png?alt=media" alt="Template Details and Template Tokens of the saved trigger: template New sign-up, tokens Recipient.FirstName Team, Email.SignatureId emlsgn_…, Email.FooterId emlftr_…"><figcaption><p>The saved template and tokens.</p></figcaption></figure>
3. Press **Save**.

## Result

Cloud goes back to **Membership Triggers**. The next matching event uses the new values.

## Change or remove it later

* **Disable / Enable** — [Enable or disable a trigger](/codemash/cloud/membership/triggers/enable.md).
* **Delete** — [Delete a trigger](/codemash/cloud/membership/triggers/delete.md).

## Do it from code

```ts
const { trigger } = await norbix.hub.membership.getMembershipTrigger({ id });
console.log(trigger.name, trigger.when, trigger.thenAction.deliverySettings.recipients);
// Tell support about deletes OnDeleted [ 'support@example.com' ]
```

```sh
norbix hub membership trigger get trg_76FRQnqeqTbMDCwqAzCflQ
```

To change a trigger from code, send `saveMembershipTrigger` with `viewId` set to the trigger id and the whole trigger, as in [Create a trigger](/codemash/cloud/membership/triggers/new.md#do-it-from-code) (the read gives the action as `thenAction`; the save takes it as `action`). The client setup is on the [Membership page](/codemash/cloud/membership.md#use-it-from-code). API: [Get Membership Trigger](/codemash/api-reference/membership/triggers/get-membership-trigger.md) · [Save Membership Trigger](/codemash/api-reference/membership/triggers/save-membership-trigger.md)
