# Notifications

> Configure and use the OneFuse Notifications pluggable module

---

Site [llms.txt](/llms.txt)

---

OneFuse Pluggable Module: Notifications

<div class="alert alert-info" role="alert">


Pluggable Module Name is **Notifications**
</div>


## Feature highlights

- Send flexible email notifications
- Notification email subject, body, and addresses can consist of a mix of static text and dynamic content such as properties and/or custom logic
- SMTP servers are defined independently of notifications
- SMTP configurations, message content, and recipients can leverage property sets for ease of management of dynamic content

## Prerequisites

- Create a OneFuse Service Account for the SMTP server(s) used for Notifications.
- If the OneFuse Appliance does not have an internet connection, follow the instructions in the section below.

### OneFuse Appliance without internet connection

<div class="alert alert-info" role="alert">


Perform the following only if the OneFuse Appliance does **not** have an internet connection.
</div>


#### Offline setup overview

1. SSH to the OneFuse Appliance.
2. Verify that Python and `pip` are installed.
3. Perform `pip` installs.

#### Verify Python and `pip`

<div class="alert alert-info" role="alert">


Identify a system to run the Python commands from. This can be your desktop or a server in your environment. Python 3 or greater must be installed on the system.
</div>


1. Verify that Python is installed.

   <div class="alert alert-info" role="alert">


   [Python 2 has sunset](https://www.python.org/doc/sunset-python-2/). If Python 2 is installed, upgrade to the latest Python version.
   </div>


   If Python is not installed, or if you are upgrading, download the latest Python from [python.org](https://www.python.org/downloads/).

2. Verify that `pip` is installed. If it is not, [install pip](https://pip.pypa.io/en/stable/installation/).
3. Review Python's [Installing Packages](https://packaging.python.org/tutorials/installing-packages/) documentation.

#### Install the OneFuse Python Package

The OneFuse Python Module is distributed as a Python Package. Install it using `pip`.

<div class="alert alert-info" role="alert">


It is recommended to install the latest OneFuse Python Package that matches the OneFuse Appliance version.
</div>


<div class="alert alert-info" role="alert">


If the OneFuse Python Module is already installed, skip to [Upgrade the OneFuse Python Package](#upgrade-the-onefuse-python-package).
</div>


1. Open a Command Prompt or Terminal window.
2. Install the OneFuse Python Package:
   - **Option 1, install the latest version:** Run `pip install onefuse`.
   - **Option 2, install a specific version:** Optionally, list available versions first, then run `pip install onefuse==<version>`.

#### Upgrade the OneFuse Python Package

Upgrade to the latest OneFuse Python Package using `pip`.

1. Open a Command Prompt or Terminal window.
2. Run `pip install --upgrade onefuse`.

## Setup overview

1. Download the Pluggable Module.
2. Upload the Pluggable Module.
3. Create a [Connection info](/docs/onefuse/configure/connection-info/).
4. Create the Module Policy.
5. Consume the Pluggable Module with an upstream provider.

### Download the OneFuse Pluggable Module

Access the [CloudBolt Download Article for CMP/OneFuse 2023.5](https://support.cloudbolt.io/cloudbolt/s/article/cloudbolt-2023-5--1983840286--1). The article always contains the latest Pluggable Module ZIP folder(s).

1. Log in with your CloudBolt Connect account.
2. Download the OneFuse Pluggable Module ZIP folder.

### Upload the module to OneFuse

For first-time uploads and upgrades:

1. Log in to the OneFuse UI with an account that has the OneFuse Super Admin Global role.
2. Select the wrench icon on the top left of the Top App Bar to access the [Super Admin UI](/docs/onefuse/getting-started/roles-and-permissions/super-admin-tasks/).
3. Select **Pluggable Modules**.
4. Select **Upload** on the top right of the Pluggable Module Management datatable.
5. Select **Module File (.zip)** to select the latest Pluggable Module ZIP folder.
6. Select **Upload**.
7. Upon successful upload, you are redirected to the Pluggable Module Management datatable where the newly uploaded module is listed.

### Create Connection Info

Create and manage Connection Info for the Pluggable Module Endpoint.

| Field | Description |
| --- | --- |
| **Connection Name** | In the sample payloads below, the `smtp_endpoint` value (the Connection Info name) is set to `smtp`. |
| **Connection Host** | SMTP server in FQDN or IP address format. |
| **Authentication Type** | Select **Basic**. |
| **Username/Password** | Credentials for the OneFuse Service Account in SMTP. |

### Access Module Policies

1. Log in to the OneFuse UI.
2. In the Workspace, select **Module** > **Notifications** (under the Pluggable section) from the left navigation menu.

This area displays all active Module Policies and Deployments. Perform the following from the Actions column:

| Action | Workspace role(s) |
| --- | --- |
| View | Admins, Members, or Viewers |
| Edit | Admins or Members |
| Delete | Admins or Members |

### Manage Pluggable Module Policies

Once the Pluggable Module is uploaded by a OneFuse Super Admin, you can manage Pluggable Module Policies. Create a [Connection info](/docs/onefuse/configure/connection-info/) to the Pluggable Module Endpoint before proceeding.

**Module Policy form fields:**

| Field | Description |
| --- | --- |
| **Module Policy Name** | Enter a name for this Module Policy. |
| **Description** | Optional description for this Module Policy. |
| **Policy Parameters** | Provide provisioning and deprovisioning scenarios. Refer to [Sample payloads](#sample-payloads) for examples. |
| **Day2 Action Parameters** | Optional. Provide Day2 Action parameters. |

**Create a Module Policy:**

1. [Access Module Policies](#access-module-policies).
2. Select **Create** on the top right of the Notifications Policies datatable.
3. Fill out the Module Policy form. Refer to [Sample payloads](#sample-payloads) for Policy Parameters examples.
4. Enter Policy Parameters for provisioning and/or deprovisioning scenarios.
5. Select **Create**.

**Update a Module Policy:**

1. [Access Module Policies](#access-module-policies).
2. Find the Module Policy to update and select the edit icon.
3. Edit the information on the Module Policy form.
4. Select **Update**.

**Delete a Module Policy:**

<div class="alert alert-warning" role="alert">


Module Policies cannot be deleted if they are associated to a OneFuse Module Deployment.
</div>


1. [Access Module Policies](#access-module-policies).
2. Find the Module Policy and select the delete icon.
3. Select **Delete** to confirm.

## Sample payloads

See [Sample payloads](/docs/onefuse/configure/pluggable-modules/sample-payloads/#notifications) for Notifications policy parameter examples.

### Optional policy parameters

| Parameter | Description |
| --- | --- |
| `bcc_addresses` | Provide an array of email addresses to BCC on the email notification. |
| `cc_addresses` | Provide an array of email addresses to CC on the email notification. |
| `email_format` | Defaults to `html`. Options are: `html` or `text`. |
| `from_name` | Display name of sender, for example, John Doe. |
| `onefuse_property_sets` | Array of objects for using Property Sets. Refer to the example below. Reference properties within a Property Set in the Policy Parameters with: `{{ resource.onefuse_property_sets.<PROPERTY SET LABEL>.rendered_properties.<PROPERTY SET PROPERTY NAME> }}` |
| `reply_to` | Specify the reply to email address. |
| `use_tls` | Specify whether or not Use TLS for SMTP is true. Defaults to `False`. |

Example:

```json
{
  "bcc_addresses": ["jdoe@example.com"],
  "cc_addresses": ["jdoe@company.com","jsmith@company.com"],
  "email_format": "html",
  "from_name": "John Doe",
  "onefuse_property_sets": [
    {
      "label": "<friendlyLabel>",
      "property_set_name": "<Property Set Name>",
      "template_properties_override": {}
    }
  ],
  "reply_to": "jdoe@example.com",
  "use_tls": "true"
}
```

## Consume with an upstream provider

The Notifications module can be consumed via:

- [OneFuse API](https://app.swaggerhub.com/apis-docs/cloudbolt/OneFuse/)
- [Ansible](/docs/onefuse/consume/red-hat-ansible/modules/pluggable-modules/)
- [Python](/docs/onefuse/consume/python-module/modules/pluggable-modules/)
- [Terraform](/docs/onefuse/consume/hashicorp-terraform/modules/pluggable-modules/)
- VMware Aria Automation [7.6](/docs/onefuse/consume/vmware-aria-automation/vrealize-automation-76/modules/pluggable-modules/) and/or [8.1+/Cloud](/docs/onefuse/consume/vmware-aria-automation/aria-automation-8x/modules/pluggable-modules/)
