# E-Mail Notification Settings

E-Mail Notification Settings are done through the settings API. Use the values from the following table to set Email Notifications up through API.

| Setting name                 | Settings Type   | Value type | example             |
| ---------------------------- | --------------- | ---------- | ------------------- |
| smtp\_default\_\_\_recipient | email\_settings | String     | <admin@example.net> |
| smtp\_default\_\_\_sender    | email\_settings | String     | <admin@example.net> |
| smtp\_port                   | email\_settings | Integer    | 587                 |
| smtp\_server\_name           | email\_settings | String     | Mailserver\_A       |
| smtp\_server\_username       | email\_settings | String     | admin               |
| smtp\_server\_password       | email\_settings | String     | password            |
| smtp\_timeout                | email\_settings | Integer    | 10                  |
| smtp\_email\_enable          | email\_settings | Boolean    | True                |

## Create Setting

<mark style="color:green;">`POST`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/settings`

Creates a Trilio setting.

#### Path Parameters

| Name         | Type   | Description                           |
| ------------ | ------ | ------------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service          |
| tenant\_id   | string | ID of the Tenant/Project to work with |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | Project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Content-Type      | string | application/json                          |
| Accept            | string | application/json                          |
| User-Agent        | string | python-workloadmgrclient                  |

{% tabs %}
{% tab title="200 Response upon successfully starting the workload creation process." %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 04 Feb 2021 11:55:43 GMT
Content-Type: application/json
Content-Length: 403
Connection: keep-alive
X-Compute-Request-Id: req-ac16c258-7890-4ae7-b7f4-015b5aa4eb99

{
   "settings":[
      {
         "created_at":"2021-02-04T11:55:43.890855",
         "updated_at":null,
         "deleted_at":null,
         "deleted":false,
         "version":"4.0.115",
         "name":"smtp_port",
         "project_id":"4dfe98a43bfa404785a812020066b4d6",
         "user_id":null,
         "value":"8080",
         "description":null,
         "category":null,
         "type":"email_settings",
         "public":false,
         "hidden":0,
         "status":"available",
         "is_public":false,
         "is_hidden":false
      }
   ]
}
```

{% endtab %}
{% endtabs %}

### Body format

Setting create requires a Body in json format, to provide the requested information.

```
{
   "settings":[
      {
         "category":null,
         "name":<String Setting_name>,
         "is_public":false,
         "is_hidden":false,
         "metadata":{
            
         },
         "type":<String Setting type>,
         "value":<String Setting Value>,
         "description":null
      }
   ]
}
```

## Show Setting

<mark style="color:blue;">`GET`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/settings/<setting_name>`

Shows all details of a specified setting

#### Path Parameters

| Name          | Type   | Description                                         |
| ------------- | ------ | --------------------------------------------------- |
| tvm\_address  | string | IP or FQDN of Trilio Service                        |
| tenant\_id    | string | ID of the Project/Tenant where to find the Workload |
| setting\_name | string | Name of the setting to show                         |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | Project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Accept            | string | application/json                          |
| User-Agent        | string | python-workloadmgrclient                  |

{% tabs %}
{% tab title="200 " %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 04 Feb 2021 12:01:27 GMT
Content-Type: application/json
Content-Length: 380
Connection: keep-alive
X-Compute-Request-Id: req-404f2808-7276-4c2b-8870-8368a048c28c

{
   "setting":{
      "created_at":"2021-02-04T11:55:43.000000",
      "updated_at":null,
      "deleted_at":null,
      "deleted":false,
      "version":"4.0.115",
      "name":"smtp_port",
      "project_id":"4dfe98a43bfa404785a812020066b4d6",
      "user_id":null,
      "value":"8080",
      "description":null,
      "category":null,
      "type":"email_settings",
      "public":false,
      "hidden":false,
      "status":"available",
      "metadata":[
         
      ]
   }
}
```

{% endtab %}
{% endtabs %}

## Modify Setting

<mark style="color:orange;">`PUT`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/settings`

Modifies the provided setting with the given details.

#### Path Parameters

| Name         | Type   | Description                             |
| ------------ | ------ | --------------------------------------- |
| tvm\_address | string | IP or FQDN of Trilio Service            |
| tenant\_id   | string | ID of the Tenant/Project to work with w |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | Project to run the authentication against |
| X-Auth-Token      | string | Authentication token to use               |
| Content-Type      | string | application/json                          |
| Accept            | string | application/json                          |
| User-Agent        | string | python-workloadmgrclient                  |

{% tabs %}
{% tab title="200 Setting modify request has been done" %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 04 Feb 2021 12:05:59 GMT
Content-Type: application/json
Content-Length: 403
Connection: keep-alive
X-Compute-Request-Id: req-e92e2c38-b43a-4046-984e-64cea3a0281f

{
   "settings":[
      {
         "created_at":"2021-02-04T11:55:43.000000",
         "updated_at":null,
         "deleted_at":null,
         "deleted":false,
         "version":"4.0.115",
         "name":"smtp_port",
         "project_id":"4dfe98a43bfa404785a812020066b4d6",
         "user_id":null,
         "value":"8080",
         "description":null,
         "category":null,
         "type":"email_settings",
         "public":false,
         "hidden":0,
         "status":"available",
         "is_public":false,
         "is_hidden":false
      }
   ]
}
```

{% endtab %}
{% endtabs %}

### Body format

Workload modify requires a Body in json format, to provide the information about the values to modify.

```
{
   "settings":[
      {
         "category":null,
         "name":<String Setting_name>,
         "is_public":false,
         "is_hidden":false,
         "metadata":{
            
         },
         "type":<String Setting type>,
         "value":<String Setting Value>,
         "description":null
      }
   ]
}
```

## Delete Setting

<mark style="color:red;">`DELETE`</mark> `https://$(tvm_address):8780/v1/$(tenant_id)/settings/<setting_name>`

Deletes the specified Workload.

#### Path Parameters

| Name          | Type   | Description                                    |
| ------------- | ------ | ---------------------------------------------- |
| tvm\_address  | string | IP or FQDN of Trilio Service                   |
| tenant\_id    | string | ID of the Tenant where to find the Workload in |
| setting\_name | string | Name of the setting to delete                  |

#### Headers

| Name              | Type   | Description                               |
| ----------------- | ------ | ----------------------------------------- |
| X-Auth-Project-Id | string | Project to run the authentication against |
| X-Auth-Token      | string | Authentication Token to use               |
| Accept            | string | application/json                          |
| User-Agent        | string | python-workloadmgrclient                  |

{% tabs %}
{% tab title="200 " %}

```
HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Thu, 04 Feb 2021 11:49:17 GMT
Content-Type: application/json
Content-Length: 1223
Connection: keep-alive
X-Compute-Request-Id: req-5a8303aa-6c90-4cd9-9b6a-8c200f9c2473
```

{% endtab %}
{% endtabs %}


---

# 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://docs.trilio.io/openstack/tvo-4.1/api-guide/e-mail-notifications.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.
