# Email Notifications of New Tickets

This guide explains how to set up automatic email notifications for new tickets that meet specific criteria.

## Use Case

For instance, you may want your engineering team to receive an email notification whenever a new ticket with potential savings greater than $500 is created. This ensures that they can prioritize and address such tickets promptly.

{% hint style="success" %}

### Prerequisite

Ensure that the email ID(s) receiving notifications have **OneLens access** within your organization.
{% endhint %}

## Video Guide

For a more detailed walkthrough, refer to the video available here.

{% embed url="<https://youtu.be/86Y2Pbs9egE>" %}

## Step-by-Step Guide

{% stepper %}
{% step %}

### Access Workflows

1. Navigate to the **workflow** section of OneLens.
2. Click the **Create** button in the top-left corner to start a new workflow.

<figure><img src="/files/28IRgIW1wZ1Etb3BQVUi" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create a New Workflow

1. A dialog box will appear asking for a workflow name. Enter a descriptive name (e.g., Send Email Alerts for High-Value Tickets).
2. You can also add a *description*, which is optional.
3. Once you’ve filled in the details, click **Create** to proceed.

<img src="/files/rKQIppb4cHN7Ks7pmdiU" alt="" width="563">
{% endstep %}

{% step %}

### Choose the Trigger

1. In the workflow setup, select the **Tickets** option as your trigger.
2. For this scenario, choose **Ticket is Created**, as you want to trigger the workflow when a new ticket is generated.

   <figure><img src="/files/3F4uvZ2QVSMX0pVZZJNb" alt="" width="563"><figcaption></figcaption></figure>

#### **Trigger Start**

* You’ll have two options for how these conditions should be applied:
  * **Trigger when all conditions match** – the workflow will only trigger if all conditions are met.
  * **Trigger when any condition matches** – the workflow will trigger if one of the conditions is met.
* You can configure multiple conditions by clicking on the **Add Rule** button.

<img src="/files/M3RcjKrAbexjSQrVtNVW" alt="" width="563">

#### **Conditions Configuration**

Each condition involves filling out three fields:

1. **Criteria**: Choose the specific property of the ticket you want to filter by. You can use the following attributes:
   1. **Ticket**: Status, Category
   2. **Recommendation**: Potential Savings, Effort
   3. **Resource**: Name, Account, Region, Service, Tags
   4. **Cost Center (Org Hierarchy)**: Cost Center, Category
   5. **Policy**: Name, Category
2. **Limit**: Set a comparison operator or criteria type for the selected attribute. The available options vary based on the chosen criteria.
3. **Borderline**: Set the specific value or list of values to compare against.

<img src="/files/k10s3WOWTSZGmuH8nmLb" alt="" width="563">

#### **Example: Recommendation > Potential Savings**

* **Criteria**: Potential Savings
* **Limit**: Greater Than
* **Borderline**: 500 (this would filter for tickets where potential savings are greater than $500).

You can set multiple conditions, each with unique criteria, limits, and boundaries, depending on the ticket types you wish to target.

Once all conditions are defined, click **Save Changes** to finalize the trigger.
{% endstep %}

{% step %}

### Set Up Email Notifications

* After defining the trigger and conditions, click **Add Step**.
* Under Messaging, choose **Send Email to Users**.

![](/files/w3UulV1EukznEdgs8Tc2)

#### **Configure Email**

Add the following details:

* **Recipients**: Enter the email addresses of the users who should receive the email notifications.
* **Cc/Bcc**: Optionally, add additional recipients in the Cc or Bcc fields.
* **Subject**: Specify the subject line for the email notification.
* **Message**: Enter the email's body content, including relevant details for the recipients.

<img src="/files/lH1fy79tQXkHrv2pLrMq" alt="" width="563">

#### **Preview the Email**

To ensure the email looks as expected, you can preview it before sending it.

Click on **Show preview with mock data** to view the email preview. This will display how the email will appear with sample data, allowing you to verify its format and content.

Once you're satisfied with the preview, click on **Save Changes**.

<img src="/files/ynjsgxRTftbXwQryqJsn" alt="" width="563">
{% endstep %}

{% step %}

### Publish the Workflow

Review the workflow representation to ensure everything is set up correctly.

Click **Publish** to make the workflow active.

<img src="/files/gQ2QP0SC8lY7fFqNY0xv" alt="" width="563">
{% endstep %}
{% endstepper %}

## Result

Here is how your email would look:

<figure><img src="/files/Yz4wXou8QYQgiqMwUkmo" alt="" width="375"><figcaption></figcaption></figure>


---

# 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.onelens.cloud/automate/workflows-and-automation/usecases/email-notifications-of-new-tickets.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.
