> 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/troubleshoot-common-whatsapp-api-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="https://2303112206-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F53n17VnOICC1LtDqlENV%2Fuploads%2FD5LAnQvHR88zQbpMTBeN%2FUntitled%20design%20(26).gif?alt=media&amp;token=93f42daa-e033-4dec-af1c-475500dd0d92" 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="https://2303112206-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F53n17VnOICC1LtDqlENV%2Fuploads%2Ffgh5pZjvCWdJr5evXcWW%2FUntitled%20design%20(27).gif?alt=media&amp;token=e3a1e451-75a9-4581-b027-39442ff2fd4e" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
