Skip to main content

Push Dispatchers

It is a part of the system responsible for delivering rendered, personalized Insight Messages via integrated push channels. It is recommended to use push dispatchers if the communication with message's receiver should be initiated automatically by the Insights Factory System as soon as the message is ready to be delivered (without need of receiver's interaction with the system).

Examples of channels that could be integrated

Channels sending messages directly to the end user (e.g.):

  • SMS
  • email
  • mobile push notification
  • web push notification

Channels sending messages to 3rd party systems (e.g.):

  • Enterprise Resource Planning systems - ERP systems
  • Bank's customer relationship management system - CRM systems
  • Internet of things systems - IoT systems
  • Notification systems like Meniga Service Notification (when integrated supported notification channels like Mandrill or Firebase should work out of the box)
note

Above channels are just an example and still require implementation, see section How to integrate a push channel?

How to integrate a push channel?

To integrate a new push channel to the Insights Factory System following points have to be fulfilled:

  • the Channel is added to the insightsfactory.channels table and its type is set to Push
  • at least one Content template is added to the database and it is assigned to the Channel
  • the dedicated push dispatcher application (with class implementing IChannelDispatcher interface) is added to the Message Dispatcher Node.
IChannelDispatcher interface
{
public interface IChannelDispatcher
{
Task Dispatch(Message message);
Task Abort(Message message);
}
}

What can prevent Insight Message delivery?

  • deleting an Insight Definition - if Bank Administrator deletes an Insight Definition the system would set corresponding Insight Messages as deleted.

  • occurrence of the new version of the event that Insight Definition triggering the message is assigned to. This way generated Insight Messages would be treated as irrelevant.

Both irrelevant and deleted messages would be skipped by dispatcher while fetching messages to be passed to the delivery mechanisms. However, if the message processed by a push dispatcher has already been passed to the delivery mechanism it would be delivered to the receiver despite being set as irrelevant or deleted in the Insight Factory System.

Example

  • There is integrated e-mail push channel with Text with background image Content Template assigned to it.
Content Template scheme
{
"Body":"
<img src='{{heroImageUrl}}' class='a-background-image' alt='{{heroImageAltText}}' />
<p>{{description}}</p>
<a href='{{deepLink}}'>
<button>{{buttonText}}</button>
</a>
",
"DeepLink":"{{deepLink}}",
"Title": "{{emailTitle}}"
}
  • There is an active Insight Definition using the e-mail push channel with defined Insight Definition Content Template
Insight Definition Content Template
{
"DataModel": {
"heroImageUrl": "https://cdn.meniga.com/watering-plants.jpg",
"heroImageAltText": "Watering plants",
"description": "Would you like to watch your money grow while also contributing to a greener future? That {{e.amountToSpare}} {{e.userCurrency}} of spare cash can provide you returns up to {{r.investmentRepository.GetPercent(e.userIdentifier)}} % in a diverse portfolio of sustainable investments",
"deepLink": "/tips/start-investing",
"buttonText": "Start investing",
"emailTitle": "What about contributing to a greener future?"
}
}
  • in the system occurs the event that triggers the above definition
Event properties
{
"amountToSpare": "1000",
"userCurrency": "EUR",
"userIdentifier": "798BE9E4-7B2F-4F06-93C1-CF4DD1109A5D"
}
  • all criteria in defined in the definition's Triggering Conditions and Audience Conditions are passed

  • function GetPercent(e.userIdentifier) from investmentRepository returns 5 for user with identifier 798BE9E4-7B2F-4F06-93C1-CF4DD1109A5D

  • dispatcher application retrieves email address john.smith@gmail.com for user with identifier 798BE9E4-7B2F-4F06-93C1-CF4DD1109A5D

  • end user should receive the email titled What about contributing to a greener future? to his email box john.smith@gmail.com Email example