This repository is part of the commercial open-source project CZERTAINLY. You can find more information about the project at CZERTAINLY repository, including the contribution guide.
Email Notification Provider Connector
is the implementation of the following Function Groups
and Kinds
:
Function Group | Kind |
---|---|
Notification Provider |
EMAIL |
Software Cryptography Provider implements cryptographic key management function based on the software keystore managed data. Therefore, it is not recommended to use this provider for the production environment, where you require higher protection of the cryptographic keys. The Software Cryptography Provider is intended for the development and testing purposes.
It is compatible with the Notification Provider
interface. This connector provides the following features:
- Send email notifications
Email Notification Provider Connector
requires the PostgreSQL database to store the data.
Email Notification Provider implements Notification Provider
interfaces. To learn more about the interfaces and end points, refer to the CZERTAINLY Interfaces.
For more information, please refer to the CZERTAINLY documentation.
Email Notification Provider Connector
is provided as a Docker container. Use the czertainly/czertainly-email-notification-provider:tagname
to pull the required image from the repository. It can be configured using the following environment variables:
Configuring instance of this Email Notification Provider requires to provide the following attributes:
Attribute | Description | Content Type |
---|---|---|
Sender email address | Email address from which the notification will be sent | STRING |
Subject | Subject of the email that will be sent | STRING |
Content Template | HTML template to be used to send information in email | CODEBLOCK |
Subject and Content Template attributes support variables that are replaced during notification processing. Variables are replaced with the data coming from the request for notification.
The varaibles are written in format ${variable}
.
The following is an example of the Content Template with variables:
<h3>Certificate status change!</h3>
<p>
The certificate identified as:
<ul>
<li>Subject: ${notificationData.subjectDn}</li>
<li>Serial Number: ${notificationData.serialNumber}</li>
<li>Issuer: ${notificationData.issuerDn}</li>
</ul>
</p>
<button onclick="location.href='https://yourdomain.com/administrator/#/certificates/detail/${notificationData.certificateUuid}'"
type="button">
Go To Certificate
</button>
The variables will be replaced with values in the notification request, for example:
{
"recipients": [
{
"name": "John Doe",
"email": "john.doe@example.com",
"mappedAttributes": [
]
}
],
"eventType": "certificate_status_changed",
"resource": "certificates",
"notificationData": {
"oldStatus": "valid",
"newStatus": "expiring",
"subjectDn": "CN=test",
"serialNumber": "4a25c46b33ee052d242023f5dfaaafd3694858a4",
"issuerDn": "CN=issuer",
"certificateUuid": "7de49ef9-8244-4e8f-95b8-82205ae0ad48"
}
}
Will parse the final notification Content Template to be:
<h3>Certificate status change!</h3>
<p>
The certificate identified as:
<ul>
<li>Subject: CN=test</li>
<li>Serial Number: 4a25c46b33ee052d242023f5dfaaafd3694858a4</li>
<li>Issuer: CN=issuer</li>
</ul>
</p>
<button onclick="location.href='https://localhost/administrator/#/certificates/detail/7de49ef9-8244-4e8f-95b8-82205ae0ad48'"
type="button">
Go To Certificate
</button>
To enable DEBUG logs for the implementation of the email notification provider, you need to set the following environment variable:
LOGGING_LEVEL_COM_CZERTAINLY=DEBUG
To enable DEBUG logs for the mail sending process and SMTP related information, you need to set the following environment variable:
SPRING_MAIL_PROPERTIES_MAIL_DEBUG=true