Sending a notification
The plugin can be used for sending many kinds of notifications such as emails or SMS notifications. It can be easily integrated in one of your business processes.
Configuring the process
To configure a business process that sends notifications you must follow the next steps:
- use FlowX Designer to create/edit a notification template
- use Process Designer to add a Send Message Task and a Receive Message Task
- configure the needed node actions
- configure the request body
DEVELOPER: Make sure the needed Kafka topics are configured properly.
Kafka topic names can be set by using the following environment variables:
KAFKA_TOPIC_NOTIFICATION_INTERNAL_IN
- topic used to trigger the request to send a notificationKAFKA_TOPIC_NOTIFICATION_INTERNAL_OUT
- topic used for sending replies after sending the notification
The following values are expected in the request body:
Key | Definition | |
---|---|---|
language | The language that should be used | Mandatory |
templateName | The name of the notification template that is used | Mandatory |
channel | Notification channel: SMS/MAIL | Mandatory |
receivers | Notification receivers: email/phone number | Mandatory |
senderEmail | Notification sender email | Optional |
senderName | Notification sender name | Optional |
attachments | Attachments that are sent with the notification template (only used for MAIL notifications) | Optional |
Check the detailed example below.
Example: send a notification from a business flow
Let’s pick a simple use-case, say we need to send a new welcome letter when we onboard a new customer. The steps are the following:
- Configure the template that you want to use for the welcome email, see the previous section, Managing notification templates for more information.
- Use the FlowX.AI Designer to add a Send Message Task and a Receive Message Task.
- On the Send Message Task add a proper configuration to the action, the Kafka topic and request body message to be sent:
- Topics -
KAFKA_TOPIC_NOTIFICATION_INTERNAL_IN
- (in our example,flowx-notifications-qa
)
You can check the defined topics by going to FlowX Designer > Platform Status > notification-plugin-mngt > kafkaTopicsHealthCheckIndicator > details > configuration > topic > notifications.
- Message (expected parameters):
- templateName
- channel
- language
- receivers
- Headers - it is always
{"processInstanceId": ${processInstanceId}}
- On the Receive Message Task add the needed topic to receive the kafka response -
KAFKA_TOPIC_NOTIFICATION_INTERNAL_OUT
- (in our example,ai.flowx.updates.qa.notification.request.v1
).
- Run the process and look for the response (you can view it via the Audit log) or checking the responses on the Kafka topic defined at
KAFKA_TOPIC_NOTIFICATION_INTERNAL_OUT
variable.
Response example at KAFKA_TOPIC_NOTIFICATION_INTERNAL_OUT
:
Was this page helpful?