> For the complete documentation index, see [llms.txt](https://help.cosmobots.io/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.cosmobots.io/help/outros/dicas/retornar-mensagem-quando-o-e-mail-for-invalido.md).

# Validar e-mail

{% embed url="<https://drive.google.com/file/d/18IYZOibjNgNkuxFwSxRZ1hmbGJg7dhSP/view?usp=sharing>" %}

Atualmente temos um campo chamado usuário e-mail que já faz essa validação, porém ele retorna automaticamente para o usuário informar novamente o e-mail, pois a validação é interna.

Para conseguir retornar uma mensagem de e-mail incorreto ao usuário, é necessário seguir alguns passos:

1- No bot que quer criar a validação, vá em **Base de Dados> Usuários** e cliquem em **Campos**:

![](/files/-Mi72-coQsDtUf9K8Jv7)

2- Em Campos, clique em **Novo Campo**, em **Rótulo** coloque o nome **e-mail do usuário**, em **Tipo** coloque **Texto**, em **Subtipo** coloque **Livre**, em **Formato** coloque **Aberto** e salve:

![](/files/-Mi721p4iwx3y3woVqib)

3- No fluxo em que quer colocar a validação, vá na mensagem que pergunta o e-mail do usuário, clique em **Salvar Resposta** e em **Escolha um campo para resposta**, selecione o campo usuário e-mail do usuário:

![](/files/-Mi74A8Co6v3uWlS9EJp)

4- Abaixo da mensagem que pergunta o e-mail adicione um **Filtro**, em **Critérios>Campo**, coloque o campo usuário e-mail do usuário, em **Condição** coloque **Contém** em **Valor** coloque **@,** clique em **E** para adicionar mais uma condição, e novamente em **Critérios>Campo**, coloque o campo usuário e-mail do usuário, em **Condição** coloque **Contém,** em **Valor** coloque **@** e salve:

![](/files/-Mi75gFdWh42MZdhCSuu)

Precisa ficar assim:

![](/files/-Mi75sT-fWpBbzrJqTTN)

5- Após criado, no filtro você terá 2 lados, o lado **Sim** e o lado **Não:**

![](/files/-Mi77cNgtj9iQyyQzn62)

6- Do lado **Não** do filtro, crie uma mensagem com a informação de que o e-mail é inválido:

![](/files/-Mi77ppjp7zLNPffiRlQ)

7- Abaixo da Mensagem criada, clique uma **Etapa existente**, em fluxo não precisa alterar, em **Etapa** selecione a etapa que pergunta o e-mail do usuário:

![](/files/-Mi78EcYvjgtkqDhUtzk)

Prontinho, agora os usuários que informarem o e-mail corretamente seguirão o lado sim do fluxo, e os que informarem incorreto seguirão o lado não, receberão a mensagem de e-mail incorreto e voltarão para preencher o e-mail novamente:

![](/files/-Mi796H0q50qftzc0J-q)


---

# 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://help.cosmobots.io/help/outros/dicas/retornar-mensagem-quando-o-e-mail-for-invalido.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.
