# Triggers

Triggers are actions that are executed after a certain action was done. For example, inserting a record into a collection might trigger an action to send an email message.

Triggers can be used with **collections**, **users,** and **files**.

## Trigger actions

The trigger can invoke one of the following actions.

1. Send an email
2. Send a push notification
3. Execute a function

### Sending an email

You can send emails to specific email addresses or your project users. Token binding in your email templates works the same way as sending emails normally. More about email templates and token binding check the following links.

{% content-ref url="../dashboard/notifications/email/templates" %}
[templates](https://docs.codemash.io/dashboard/notifications/email/templates)
{% endcontent-ref %}

{% content-ref url="tokens-binding" %}
[tokens-binding](https://docs.codemash.io/other-topics/tokens-binding)
{% endcontent-ref %}

### Sending a push notification

Just like with emails, this works the same way - you can send mobile notifications to your project users. Token binding in your push notifications works the same way as sending notifications normally. More about notification templates and token binding check the following links.

{% content-ref url="../dashboard/notifications/push/push-templates" %}
[push-templates](https://docs.codemash.io/dashboard/notifications/push/push-templates)
{% endcontent-ref %}

{% content-ref url="tokens-binding" %}
[tokens-binding](https://docs.codemash.io/other-topics/tokens-binding)
{% endcontent-ref %}

### Executing a function

This type of trigger action will call one of your functions defined in **code** module.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codemash.io/other-topics/triggers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
