Communications

Module to send notification via the module communications.

communications.sendCollectionNotification(notificationId: string, originator: object, providers: object[], collectionId: string, collectionFilter: string, trigger: object)

Send a notification with a contacts list extracted from a collection

Arguments:
  • notificationId – The Item ID of the notification to send

  • originator – The notification source.

  • providers – List of object that has to contains property providerId that is the Item ID of the provider to use.

  • collectionId – The id of the collections from which to extract the contacts to whom the notification must be sent.

  • collectionFilter – The filter to apply on the collection when extracting contacts.

  • trigger – An object containing arbitrary information that will be provided to the message generation.

communications.sendKeycloakGroupNotification(notificationId: string, originator: object, providers: object[], wantedGroups: string[], trigger: object)

Sends a notification with a contacts list extracted from Keycloak with

Arguments:
  • notificationId – The Item ID of the notification to send

  • originator – The notification source.

  • providers – List of object that has to contains property providerId that is the Item ID of the provider to use.

  • wantedGroups – The list of groups to send the notification to. If empty, everyone will be notified.

  • trigger – An object containing arbitrary information that will be provided to the message generation.

communications.sendStaticNotification(notificationId: string, originator: object, providers: object[], contactId: string, trigger: object)

Send a notification to a static define group of people.

communications.sendStaticNotification(
  "root.communication.notification",
  {
        smsSender: "Script",
        emailSenderAddress: "script@localhost",
        emailSenderName: "my super script"
    },
  [
    {
        providerId: "root.communication.provider.maildev"
    }
  ],
  "root.communication.directory",
  {
        name: "Script",
        content: true,
        timestamp: 0
    }
);
Arguments:
  • notificationId – The Item ID of the notification to send

  • originator – The notification source.

  • providers – List of object that has to contains property providerId that is the Item ID of the provider to use.

  • contactId – The id of the contact to send the notification to.

  • trigger – An object containing arbitrary information that will be provided to the message generation.