How to enable email notifications

This guide shows how to configure SMTP credentials so that OpenSearch can send email notifications via the SMTP integrator charm.

Note

SMTP integration requires Charmed OpenSearch revision 344 or higher.

Note

SMTP servers using self-signed certificates are not currently supported.

Deploy and configure the SMTP integrator

Deploy the charm:

juju deploy smtp-integrator --channel latest/edge

The charm will be blocked until configured. Provide SMTP credentials:

juju config smtp-integrator \
  host=<smtp-host> \
  port=587 \
  user=<smtp-username> \
  password=<smtp-password> \
  smtp_sender=<sender-email> \
  recipients=<recipient-1>,<recipient-2>

Integrate with OpenSearch

Connect the SMTP integrator to OpenSearch:

juju integrate smtp-integrator:smtp opensearch:smtp

Once the integration is established, juju status --relations shows both applications active with an smtp relation between them, and OpenSearch can send email notifications via the configured SMTP server.

Note

OpenSearch requires a stable identifier for each email sender, notification channel, and notification group. The charm derives this identifier from the Juju relation ID of the SMTP integration, so the relation ID must remain stable. If you remove and re-add the integration, OpenSearch treats each reconnection as a new sender and channel, and the previous entries become stale. See the OpenSearch Notifications documentation for details.

Large deployments

In large deployments, the SMTP integrator must be integrated with the main orchestrator application.

Identify the main orchestrator by inspecting juju status integrations:

Integration provider                           Requirer                                Interface           Type     Message
opensearch-main:peer-cluster-orchestrator      opensearch-data:peer-cluster            peer_cluster        regular  

Integrate with the main orchestrator:

juju integrate smtp-integrator:smtp opensearch-main

If integrated with the wrong application, the charm shows a blocked status. Remove the invalid relation and integrate with the correct application.

Next steps