Gorgias rule glossaryUpdated 24 minutes ago
This glossary outlines the options for each block of the WHEN, IF, THEN rule builder. Read on for an overview of the WHEN triggers that determine when a rule fires, the IF/AND/OR/ELSE logic operators that control conditions, the available condition types, and all the possible THEN actions a rule can take.
Requirements
- Available on all Helpdesk plans
- Agents and Leads can create and manage rules
WHEN (triggers)
When building a rule, the first step is to configure the WHEN block. The event(s) in the WHEN block are what cause the rule to fire. Rules only run when their trigger event occurs and all IF conditions are met.
| Trigger | Description |
| Ticket Updated | Rules with this trigger run any time a ticket is changed, including:
Note: this trigger does not fire on changes to message intents or message body. |
| Ticket Assigned To User | Rules with this trigger run when a ticket is assigned to user. The rule will not run if the ticket is assigned to a team, unless the team has auto-assignment enabled. Auto-assignment will assign a user, which will then trigger the rule. |
| Ticket Snooze Delay Ends | Rules with this trigger run when a ticket's snooze timer expires. You can use this trigger to create time-delayed actions by pairing two rules: the first rule snoozes the ticket for a set duration; the second rule triggers when that snooze ends. For example, to send a chat follow-up if a customer hasn't responded in 15 minutes, create a rule that snoozes the ticket for 15 minutes after every agent message, and the second rule sends a follow-up message when the snooze ends. |
| New Message In Ticket | Rules with this trigger run every time a new message arrives in a ticket, whether sent by a customer, an agent, or another rule. |
| Satisfaction Survey Responded | Fires when a customer submits a response to a satisfaction survey. |
IF, AND, OR, and ELSE
These operators control the relationship between conditions in a rule.
IF
Defines the criteria a ticket must meet for the action stated in the THEN block to run. A rule can technically work with only a WHEN and THEN block, but adding an IF block adds conditions, allowing you to be more specific about the tickets the rule runs for. Clicking an existing IF block shows options to add an AND condition, OR condition, or ELSE block.
AND
When AND is present in a rule, all the listed criteria in it's block must be true for the rule to run.
For example, if your rule is:
IF: message body contains test
AND: message sender email is [email protected]
AND: ticket created date is after 01/01/2021
The rule will only fire on tickets that contain the word "test", from [email protected], created after January 1, 2021.
OR
When OR is present in a rule, at least one of the listed criteria must be true true for the rule to run.
For example, if your rule is:
IF: message body contains test
OR: message sender email is [email protected]
OR: ticket created date is after 01/01/2021,
The rule will fire on a ticket with the word "test", even if the other two conditions aren't true.
ELSE
ELSE is a fallback branch to determine what the rule does to tickets that don't meet all the conditions. When all of the IF conditions are met, the ELSE branch is ignored. If the IF conditions are not met, the rule moves on to the ELSE branch to take an action.
For example, if your rule is:
IF: message sender email is [email protected]
AND: message body contains test
THEN: add tag test-1
ELSE: add tag not-test
When the rule fires, it can take two actions:
- Tickets from
[email protected]with bodytestwill be tagged taggedtest-1 - All other tickets will be tagged
not-test
Rule conditions
When you add an IF/AND/ELSE block to your rule, you'll select the conditions that the rule looks out for. You can configure IF/AND/ELSE blocks with any of the conditions below.
Message conditions
| Condition | Description |
| Message Body | Searches for specific text in the message, including visible hyperlinks in the ticket. Use the following operators to target specific text
|
| Message Channel | Selects which channel the message was sent or received on. Use is to target a specific channel or is not to exclude one. |
| Message Created Date | Matches messages created before or after a specific date, during or outside business hours, or within/outside a relative time window (minutes, hours, days, weeks ago). |
| Message From Agent | Checks whether the last message was sent by your team (is true) or a customer (is false). Messages sent from outside of Gorgias are considered agent messages. Tip: Use IF message from agent is false with a New Message In Ticket trigger to prevent a rule from firing when your team replies. |
| Message Integration | Matches a specific integration. Use this to target a particular connected channel by its integration name. |
| Message Intents | Matches AI-detected intents in the message.
|
| Message Public | Checks whether the message is public or an internal note. Tip: Use IF message public is not true to trigger on internal notes. |
| Message Sent Date | Matches the date the message was sent. Options include before/after a specific date or time, within a relative window, or during/outside business hours. Message sent date is empty is useful for catching errors with unsent outgoing messages. |
| Message Sentiments | Matches AI-detected sentiment (positive or negative tone) in the message. |
| Message Via | Matches the mechanism used to create or deliver a message within Gorgias. Unlike Message Channel (which identifies the platform), Message Via identifies the origin — for example, whether a message was sent from the Gorgias helpdesk UI, generated by a rule, or created through the API. Tip: Use this condition to handle messages differently based on how they entered the system, such as preventing rule-generated messages from triggering other rules, or auto-closing tickets only when an agent replies directly from Gorgias. |
| Message Receiver Email | Triggers when the customer's email (the recipient of your outgoing message) matches a specified address. This only applies when you are sending a message to the customer. |
| Message Source From Address | Matches the customer's email address on incoming messages. Use this to apply special handling for known addresses — for example, tagging tickets from a VIP customer's email with a VIP tag. |
| Message Source From Name | Matches the sender's name for social media tickets. Matches on the sender's social media account name, not the name in the Gorgias customer profile. |
| Message Sender Email | Triggers when the email address the message was sent from matches a specified value. This looks at the actual sending address, not the customer profile email. |
Ticket conditions
| Condition | Description |
| Ticket Assignee User | Filters by the agent currently assigned to the ticket.
|
| Ticket Assignee Team | Checks whether the ticket is assigned to a specific team. A ticket can be assigned to both a user and a team simultaneously, but never to two different users or two different teams. |
| Ticket Assignee User Email | Matches the email address of the agent assigned to the ticket. |
| Ticket Channel | Detects the channel of the first message in the ticket. Note: this never changes unless tickets are merged (in which case the oldest message determines the channel). For more precise channel matching, use Message Channel or Message Integration instead. |
| Ticket Created Date | Matches based on when the ticket (first message) was created. |
| Ticket From Agent | Checks whether the ticket was initially created by a Gorgias user (not a customer). |
| Ticket Language | Matches the detected language of the first message in the ticket — 54 language options available. The language cannot be identified if multiple languages appear in the same ticket, or if a contact form is in one language while the message body is in another. |
| Ticket Last Message Date | Matches based on the most recent message in the ticket (excluding internal notes). |
| Ticket Last Received Message Date | Same as Ticket Last Message Date, but only counts messages from customers (not agents). |
| Ticket Priority | Matches based on the ticket's priority level. |
| Ticket Reopened Date | Matches based on when the ticket was last reopened. |
| Ticket Satisfaction Survey Score | Matches based on the score the customer submitted in a satisfaction survey. |
| Ticket Unsnooze Date | Targets tickets in snoozed or open status.
|
| Ticket Status | Every ticket has one of five statuses: Spam, Deleted, Snoozed, Open, or Closed. Deleted tickets cannot trigger rules. Spam tickets cannot currently be targeted (see Ticket Spam above).
|
| Ticket Subject | Matches the ticket subject line. Useful for auto-closing predictable emails (e.g., out-of-office replies, order delivered notifications), routing specific form submissions, or handling Voice tickets (subject starts with "call from"). |
| Ticket Tags | Matches based on tags applied to the ticket.
|
| Ticket Fields | Matches based on the value of a custom Ticket Field. |
| Ticket Via | Identifies the platform used to send the first message in a ticket (e.g., email, chat). Like Ticket Channel, this only reflects the first message. |
Customer conditions
| Condition | Description |
| Customer Email | Matches based on a specified customer email value. |
| Customer Fields | Matches based on the value of a custom Customer Field. |
| Customer Other Integrations | Temporarily decommissioned. Under development. |
| Customer Data | Temporarily decommissioned. Under development. |
Self Service conditions
These conditions are available to accounts with an AI Agent subscription.
| Condition | Description |
| Order Management Flow | Targets tickets related to Order Management inquiries. |
| Self-Service Store | Detects tickets created via Order Management in a Help Center connected to your store, so you can tag and prioritize them appropriately. |
E-commerce conditions
Shopify — Last Order
| Condition | Description |
| Created Date | Targets customers based on when their last order was placed. Useful for following up on unfulfilled orders (e.g., last order created date is more than 5 days ago). |
| Financial Status | Matches the payment status of the last order. |
| Fulfillment Status | Matches the fulfillment status (fulfilled, partially fulfilled, restocked, etc.). |
| Tags | Matches Shopify order tags. Gorgias can't automatically sync Shopify tags, but this condition lets you check for them and act accordingly. This looks at unfulfilled Shopify orders (there may be more than one). |
| Total Price | Matches the total price of the last order. Use is greater than, is less than, etc. The currency is whatever your Shopify store uses — enter a number only. Example: IF total price of last order is greater than 20 triggers for orders over $20. |
| Last Fulfillment Created Date | Targets tickets based on when the customer's last fulfilled order was created. |
| Last Fulfillment Shipment Status | Matches the current shipment status of the last fulfillment. |
| Last Fulfillment Status | Matches the fulfillment status of the current order. |
| Last Fulfillment Tracking Number | Checks whether the last fulfillment has a tracking number (is empty / is not empty). Useful for auto-replies: send the tracking number when one exists, or notify the customer when no tracking is available. |
| Shipping Address Country | Triggers based on the country the last order is being shipped to. |
| Shipping Address Province | Same as Shipping Address Country, but for province/state. |
Shopify — Customer
| Condition | Description |
| Created Date | Triggers based on when the customer's Shopify profile was created. |
| Order Count | Matches how many orders the customer has placed. Note: order count cannot be 0 — use is less than 1 to target customers who have not yet placed an order. |
| Tags | Matches Shopify customer tags. Use this to transfer tags from Shopify to Gorgias or trigger actions based on customer segments. |
| Total Spent | Matches the total amount the customer has spent across all orders. Useful for flagging high-value customers. |
Shopify — Metafields
If you've imported Shopify metafields into your helpdesk, you can use them in rules to trigger when the metafield on the ticket matches the metafield defined in the rule.
Magento 2 — Last Order
| Condition | Description |
| Date of Last Order | Targets customers based on when their most recent order was placed. Combine with the State condition to catch delayed shipments: e.g., IF date of last order is more than 5 days ago AND state is not completed, closed, or canceled. |
| Grand Total | Matches the total price of the last order. Currency follows your Magento store's default. |
| Created Date | Refers to the shipping date of the last order. Useful for auto-tagging tickets about delayed deliveries. |
| State | Matches the order state. Combine with Date of Last Order for shipping delay auto-replies. |
Magento 2 — Customer
| Condition | Description |
| Created Date | Triggers based on when the customer's Magento profile was created. |
BigCommerce — Last Order
| Condition | Description |
| Created Date | Targets customers based on when their last order was placed. |
| Status | Matches the status of the last order. |
| Total Price | Matches the total price of the last order, including tax. |
| Shipping Date | Matches the date the last order was shipped. |
| Last Order Shipments — Tracking Number | Checks whether the last order shipment has a tracking number (is empty / is not empty). |
| Last Shipping — Country | Triggers based on the destination country of the last order. |
| Last Shipping — State | Triggers based on the destination state of the last order. |
| Last Shipping — City | Triggers based on the destination city of the last order. |
BigCommerce — Customer
| Condition | Description |
| Created Date | Triggers based on when the customer's BigCommerce profile was created. |
Instagram profile conditions
| Condition | Description |
| Business Follows Customer | Checks whether your business account follows the customer on Instagram. |
| Customer Follows Business | Checks whether the customer follows your business account on Instagram. |
| Followers Count | Matches the customer's Instagram follower count. |
| Username | Matches the customer's Instagram username. |
| Verified | Checks whether the customer's Instagram account is verified. |
THEN (actions)
| Action | Description |
| Send email | Sends an email to specified recipients (To, Cc, Bcc) with a subject and body. Maximum 15 total recipients. |
| Reply to customer | Sends a reply to the customer on the ticket. |
| Add internal note | Adds an internal note to the ticket, visible to agents only. |
| Apply macro | Executes a predefined macro on the ticket. |
| Add tags | Adds one or more tags to the ticket without removing existing tags. |
| Remove tags | Removes one or more specified tags from the ticket. |
| Reset tags | Replaces all existing ticket tags with the specified ones. |
| Set subject | Updates the ticket subject line. |
| Set status | Changes the ticket status (e.g., open, closed, snoozed). |
| Set priority | Sets the ticket priority level. |
| Set ticket field | Sets the value of a custom ticket field. |
| Set customer field | Sets the value of a custom field on the customer record. |
| Snooze for | Snoozes the ticket for a specified duration. Cannot be used on closed tickets. |
| Assign agent | Assigns the ticket to a specific agent. |
| Assign team | Assigns the ticket to a specific team. |
| Distribute to teams | Distributes the ticket across teams. |
| Delete ticket | Moves the ticket to trash. |
| Hide Facebook comment | Hides a Facebook comment from public view. Note: excessive use may deactivate your Facebook page. |
| Like Facebook comment | Adds a like to a Facebook comment. Note: excessive use may deactivate your Facebook page. |
| Exclude ticket from Auto-Merge | Prevents this ticket from being automatically merged with other tickets. |
| Exclude ticket from CSAT | Prevents a CSAT satisfaction survey from being sent for this ticket. |