1. Home
  2. Customizing Slack and Teams notifications

Customizing Slack and Teams notifications

Overview

Diplomat MFT provides notifications for Transactions over Slack and/or Microsoft Teams. The default notification content is usually sufficient for customers, but sometimes more control over the content is desired. This article describes how to customize those notifications for Slack and/or Microsoft Teams.

Properties File

Diplomat MFT looks for the file “diplomat.custom.properties” in the DiplomatData folder (typically “C:\ProgramData\Coviant Software\Diplomat-j” on Windows, or /opt/coviantsoftware/diplomat-j on Linux). This properties file contains name/value pairs that are used to control various aspects of Diplomat MFT operation. Attached to this article is an example “diplomat.custom.properties” that you can use to customize Slack and MS Teams notifications.

NOTE that you must restart the Diplomat MFT service for any changes to take effect.

When making changes, take care in what you change. The contents are JSON encoded values, some of which is required structure for the REST API call which Diplomat MFT makes to the service provider. Be sure to change only the human readable portions of the notification.

Placeholders

Within the notification text, there are placeholders that Diplomat MFT uses to fill in run-time information. You can remove the entire placeholder in any message to remove those values; or you can move those placeholders to different locations. Here are the placeholders:

<STATUS_ICON>This is replaced with the proper icon (emoji) to represent the status of the transaction: Success, Warning, or Failure.
<TRANS_ID>This is replaced with the name of the executed transaction which caused this notification
<STATUS>The human-readable status of this transaction execution (Success, Warning, Failure)
<AUDIT_ID>The ID of the audit record associated with this transaction execution. Useful for cross-referencing the audit database.
<MESSAGE>The entire contents of the message generated by Diplomat MFT regarding this transaction.
<FILE_LIST_ELEMENT>This is replaced by a list of all the files which were transferred during the transaction execution.
Placeholders in Slack and Teams notifications

Slack Notification

The default Slack notification is, and can be overridden in diplomat.custom.properties with the “messaging.slack.template” entry

{"attachments":[{"color":"#f2c744","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"<STATUS_ICON> *Diplomat MFT Transaction '<TRANS_ID>'* : *_<STATUS>_*"}},{"type":"divider"},{"type":"section","text":{"type":"mrkdwn","text":"*Audit ID:*\\n    <AUDIT_ID>"}},{"type":"section","text":{"type":"mrkdwn","text":"*Information:*\\n   <MESSAGE>"}},{"type":"section","text":<FILE_LIST_ELEMENT>}]}]}

Microsoft Teams Notification

The default MS Teams notification is as follows, and can be overridden in diplomat.custom.properties with the “messaging.teams.template” entry:

{"@type":"MessageCard","@context":"http://schema.org/extensions","themeColor":"0075b0","summary":"Diplomat MFT Transaction <TRANS_ID> : <STATUS>","sections":[{"activityTitle":"![Diplomat MFT](https://www.coviantsoftware.com/img/automate.png)Diplomat MFT Transaction '<TRANS_ID>'","activitySubtitle":"<STATUS_ICON> <STATUS>","activityImage":"https://www.coviantsoftware.com/img/automate.png","facts":[{"name":"Transaction Name:","value":"   <TRANS_ID>"},{"name":"Audit ID:","value":"   <AUDIT_ID>"},{"name":"Information:","value":"   <MESSAGE>"}<FILE_LIST_ELEMENT>],"markdown":true}]}

Customized Notification Example

For example, if you wanted a very simply notification to go to a Slack channel for your business unit to know when a file transfer succeeded, with a very simple message that indicates the success of the execution, you can provide the following value in the diplomat.custom.properties for the “messaging.slack.template” entry:

messaging.slack.template={"attachments":[{"color":"#f2c744","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"<STATUS_ICON> *Diplomat MFT Transaction '<TRANS_ID>'* : *_<STATUS>_*"}},{"type":"divider"},{"type":"section","text":{"type":"mrkdwn","text":"*Transaction <TRANS_ID> finished with a status of _<STATUS>_*\\n"}}}]}]}
Updated on July 8, 2022

Article Attachments

Was this article helpful?