# Alerts

{% hint style="danger" %}
**Please note:** This page is under construction and has not been finished yet.
{% endhint %}

## Introduction

Use the following to retrieve the alerts class object.&#x20;

```php
$mes = e107::getMessage();
```

## Alerts methods

### addSuccess()

```php
$mes = e107::getMessage();
$mes->addSuccess('You did it!');
```

### addError()

```php
$mes = e107::getMessage();
$mes->addError('There was a problem!');
```

### addWarning()

```php
$mes = e107::getMessage();
$mes->addWarning('You do not have access to this area!');
```

### addInfo()

```php
$mes = e107::getMessage();
$mes->addInfo('Please take note!');
```

### addDebug()

{% hint style="info" %}
*Messages assigned here will only be displayed when* [*debug mode*](/getting-started/debugging-and-problem-solving.md) *is active.*
{% endhint %}

```php
$mes = e107::getMessage();
$mes->addInfo('Please take note!');
```

### render()

None of the above methods will output anything, until you use this method to render them.

```php
$mes = e107::getMessage();
$mes->addInfo('Please take note!');
echo $mes->render();
```


---

# 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://devguide.e107.org/classes-and-methods/alerts.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.
