> For the complete documentation index, see [llms.txt](https://learn.doubletick.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.doubletick.io/troubleshoot-errors/understanding-and-troubleshooting-the-new-bot-failure-alert-email.md).

# Understanding and Troubleshooting the "New Bot Failure Alert" Email

When you receive the "New Bot Failure Alert" email, it signifies an error in the active bot you have created. This guide will walk you through understanding and resolving this issue, with an example based on a bot named "Jain Shadi."

What Does the Error Indicate?

The error message specifies that a "chat window is closed." This occurs when the bot tries to send a message to a closed chat window. In such cases, the customer has not responded, and the chat window remains closed. To proceed, you need to send a **template message**

#### Steps to Troubleshoot and Resolve the Issue

**1. Check the Bot Name**

* The email provides the name of the bot experiencing the issue. In this example, the bot name is "Jain Shadi."

**2. Review Logs**

* Click on the **View Logs** link in the email.
* The logs provide a detailed history of the bot's actions and where the error occurred. For example:
  * The bot starts with a "template delivered."
  * After a time delay, it checks a condition and then attempts to send a message.
  * If the message bounces back, it indicates the need to use a template message instead.

<figure><img src="/files/F9q8x8ls6xvHXWFagMZm" alt=""><figcaption></figcaption></figure>

**3. Debugging in Bot Studio**

* Open **Bot Studio** and search for the bot name (e.g., "Jain Shadi").
* Analyze the bot’s flow. For instance:
  * The bot sends a template.
  * There’s a time delay followed by a condition.
  * After the condition, the bot sends a message, which could fail if the chat window is closed.

**Fix the Bot Flow**

* **Add Quick Reply Buttons**: To improve customer interaction, consider adding quick reply buttons. If the customer clicks a button, the bot can then send a follow-up message.
* **Adjust Time Delays**: Ensure there is sufficient time for the customer to respond before sending additional messages.
* **Add a Template**:
  1. Delay the send message component.
  2. Insert a template message before the send message component.
  3. Either duplicate an existing template or select a new one from the action column and link it.

<figure><img src="/files/l7AvWWCMdZhO3UjDi772" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://learn.doubletick.io/troubleshoot-errors/understanding-and-troubleshooting-the-new-bot-failure-alert-email.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
