Skip to main content
Version: 2.13.0

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:

The following values are expected in the request body:

KeyDefinition
languageThe language that should be usedMandatory
templateNameThe name of the notification template that is usedMandatory
channelNotification channel: SMS/MAILMandatory
receiversNotification receivers: email/phone numberMandatory
senderEmailNotification sender emailOptional
senderNameNotification sender nameOptional
attachmentsAttachments that are sent with the notification template (only used for MAIL notifications)Optional
info

Check the detailed example below.

Define needed Kafka topics

Kafka topic names can be set by using environment variables:

  • KAFKA_TOPIC_NOTIFICATION_INTERNAL_IN - topic used to trigger the request to send a notification
  • KAFKA_TOPIC_NOTIFICATION_INTERNAL_OUT - topic used for sending replies after sending the notification

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:

  1. Configure the template that you want to use for the welcome email, see the previous section, Managing notification templates for more information.

  1. Use the FLOWX.AI Designer to add a Message send task and a Message received task.
  2. On the Message send task add a proper configuration to the action, the Kafka topic and request body message to be sent:
  • Topics - KAFKA_TOPIC_NOTIFICATION_INTERNAL_IN - flowx-notifications-qa
  • Message (expected parameters):
    • templateName
    • channel
    • language
    • receivers
  • Headers - it is always {"processInstanceId": ${processInstanceId}}

  1. On the Message received task add the needed topic to receive the kafka response - KAFKA_TOPIC_NOTIFICATION_INTERNAL_OUT - ai.flowx.updates.qa.notification.request.v1.

  1. 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:

{
"identifier": null,
"templateName": "welcomeLetter",
"language": "en",
"error": null
}

Was this page helpful?