> For the complete documentation index, see [llms.txt](https://docs.digibee.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digibee.com/documentation/developer-guide/pt-br/development-cycle/build-overview/capsulas/public-capsules/send-notifications-via-email.md).

# Enviar alerta por email

{% hint style="info" %}
Para acessar a coleção Enviar alerta por email e usar as funcionalidades presentes nesse artigo, você precisa ter a permissão PIPELINE:CREATE. Aprenda mais na[ documentação sobre Papéis](/documentation/developer-guide/pt-br/platform-administration/administration/new-access-control/access-control-roles.md).
{% endhint %}

O objetivo da coleção Enviar alerta por email é receber qualquer conteúdo JSON na entrada, além das variáveis, ​​e enviá-lo por email.

## Parâmetros estáticos de configuração da cápsula

* **smtp-email:** conta para autenticação com o servidor de email.
* **de:** endereço do remetente.
* ***environment*****:** especifica o ambiente do alerta, por exemplo, test ou prod.
* **destinatário:** destinatário para quem o email deve ser enviado. Para usar uma lista, especifique um *array* JSON em formato de *string*.
* ***pipeline*****:** o nome do *pipeline* (campo de texto livre).
* **descricao-alerta:** título que será usado no cabeçalho do email.
* **assunto:** assunto personalizado para identificar o email.

## Parâmetros dinâmicos de configuração da cápsula&#x20;

Os parâmetros também podem ser configurados dinamicamente. Para isso, informe os parâmetros dentro do objeto `"emailParams": {}`.

{% hint style="info" %}
Os parâmetros informados dinamicamente são substituídos por parâmetros estáticos.
{% endhint %}

### Entrada <a href="#entrada" id="entrada"></a>

```
{
  "logger": {
    "status": 200,
    "body": {
      "soap:Envelope": {
        "soap:Body": {
          "Erros": {
            "DescricaoErro": "Código de documento 1 não encontrado."
          },
          "ProcessamentoOK": false
        }
      }
    }
  },
  "emailParams": {
    "pipeline": "confirmar-ticket-gera",
    "descricao-alerta": "Erro ao consultar dados para integração.",
    "destinatario": "
test@digibee.com.br
",
    "environment": "TEST",
    "assunto": "Erro Pedido"
  }
}
```

### Saída <a href="#sada" id="sada"></a>

#### Sucesso <a href="#sucesso" id="sucesso"></a>

```
{  "success" : true }
```

![](/files/Dlc9lg4x83PSIFgwBm20)

#### Erro <a href="#erro" id="erro"></a>

```
{   
    "timestamp": 1559243275088,   
    "error": "Error",   
    "code": 500
}
```

<br>


---

# 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://docs.digibee.com/documentation/developer-guide/pt-br/development-cycle/build-overview/capsulas/public-capsules/send-notifications-via-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.
