# Inbound Triggers

When a user sends a reply to an SMS or a keyword to a shortcode, specific triggers can be set up to take action. The system can automatically send an autoreply and forward the inbound message to an email address or another server.

### Step 1: Accessing Triggers

After logging into your account, navigate to the left pane and click on **Triggers.** This will direct you to the triggers management screen.

<figure><img src="/files/Q90zXPw2k1eYyXLWhcSQ" alt=""><figcaption><p>SMS Triggers</p></figcaption></figure>

### Step 2: Creating a New Trigger

To set up a new trigger, click on **New Trigger**. You will be prompted to name your trigger. A meaningful name helps in identifying the trigger's purpose at a glance.

<figure><img src="/files/l8WX8REqR2ImXswv2QF4" alt=""><figcaption><p>New SMS Trigger</p></figcaption></figure>

### Step 3: Configuring Trigger Settings

On the Trigger settings page, you will find several options to customize your trigger according to your needs. These settings include:

* **Name:** Assign a name to your trigger. Choose a name that reflects the purpose of the trigger for easy identification.
* **Active:** Ensure the **Active** checkbox is selected to enable the trigger.

**Conditions**

Define the conditions that must be met for the trigger to activate. You can specify if all conditions must be met or if meeting any one condition is sufficient. For instance, you may set conditions such that only messages fulfilling all specified criteria will initiate the trigger actions.

**Actions**

After defining your conditions, select the actions to be performed when those conditions are met. The available actions include:

* **Send SMS:** Automatically sends a response SMS to the sender.&#x20;
* **Send Email:** Use macros to personalize email content, including the `#MESSAGE#` macro to incorporate the SMS message into the email. Please refer to a list of all available macros further on in this guide. There is also a checkbox to enable HTML mail if you wish to paste HTML code in for the mailer.&#x20;
* **Call URL:** Forward the message to another web service. This action pushes the message to a specified URL using a GET method, appending all message variables to the URL for easy retrieval and handling by your script.
* **Add to List:** Add the mobile number to a saved contact list.
* **Remove from List:** Removes the number from a saved contact list.&#x20;

<figure><img src="/files/H82oafo5ZSrnqlavx1v1" alt=""><figcaption><p>Trigger Settings</p></figcaption></figure>

#### Macros

Macros are a powerful feature that allows you to include dynamic content in your actions. For instance, inserting the `#MESSAGE#` macro in an email action will automatically fill in the content of the inbound SMS message.

#### Available Macros:

<table><thead><tr><th width="411">Macro</th><th>Description</th></tr></thead><tbody><tr><td><code>#MESSAGE#</code></td><td>Original message content</td></tr><tr><td><code>#MOBILENUMBER#</code> or <code>#FROM#</code> </td><td>Number the message was sent from</td></tr><tr><td><code>#FROMWITHOUTPLUS#</code></td><td>Number the message was sent from (without the +)</td></tr><tr><td><code>#INBOUNDNUMBER#</code> or <code>#TO#</code></td><td>Number the message was sent to</td></tr><tr><td><code>#DATE#</code></td><td>Date of the message</td></tr><tr><td><code>#ACCOUNTID#</code></td><td>The user account id</td></tr><tr><td><code>#ACCOUNTUSERNAME#</code></td><td>Your account username</td></tr><tr><td><code>#ACCOUNTEMAIL#</code></td><td>The email address of the user</td></tr><tr><td><code>#ACCOUNTMOBILE#</code></td><td>The mobile number of the user</td></tr><tr><td><code>#MESSAGEID#</code></td><td>Original outbount message ID (if available)</td></tr><tr><td><code>#CLIENTREFERENCE#</code></td><td>Client reference specified during message send (if available)</td></tr></tbody></table>

### Editing Saved Triggers

Any trigger you create can be edited at any time. To edit a trigger, navigate to the **Triggers** section, select the trigger you wish to modify, and make the necessary adjustments. This ensures that your automated responses and forwarding rules can evolve with your communication needs.

{% hint style="danger" %}
**Test Your Triggers:** Before fully implementing a new trigger, test it to ensure it behaves as expected. This might involve sending messages that meet the trigger's conditions to verify the actions are executed correctly.
{% endhint %}


---

# 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://panaceamobile.gitbook.io/panacea-mobile-help-centre/how-to-guides/inbound-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.
