Communications

Availability table

Controller availability

Module

Available

module.scripts

Supported feature

module.keycloak

Supported feature

communications controller

Module to send notification via the module communications.

communications.sendCollectionNotification(notificationId: string, originator: object, providers: object[], collectionId: string, collectionFilter: string, trigger: object, attachments: 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.

  • attachments –

    List of attachments to send with the notification. Each attachments is an object like:

    • format: file format (i.e. pdf)

    • name: name of file

    • content: content of the file in Base64

communications.sendKeycloakGroupNotification(notificationId: string, originator: object, providers: object[], wantedGroups: string[], trigger: object, attachments: 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.

  • attachments –

    List of attachments to send with the notification. Each attachments is an object like:

    • format: file format (i.e. pdf)

    • name: name of file

    • content: content of the file in Base64

communications.sendPlainContactNotification(notificationId: string, originator: object, providers: object[], plainContacts: object[], trigger: object, attachments: object[], onlySendNotificationIfEveryRecipientIsCorrect?: boolean)

Sends a notification with a plain contacts list provided by the script directly. Plain contact are objects composed of two fields: contact: email or number (string) and type: Email or Phone.

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.

  • plainContacts –

    The list of contacts (email or phone numbers) to send the notification to.

    Plain contact are objects composed of two fields:

    • contact: email or number (string)

    • type: Email or Phone

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

  • attachments –

    List of attachments to send with the notification. Each attachments is an object like:

    • format: file format (i.e. pdf)

    • name: name of file

    • content: content of the file in Base64

  • onlySendNotificationIfEveryRecipientIsCorrect – If set to true, every contact must be valid in order to notify any of them. Otherwise, if set to false, invalid contacts are ignored and the other are notified.

communications.sendStaticNotification(notificationId: string, originator: object, providers: object[], contactId: string, trigger: object, attachments: 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.

  • attachments –

    List of attachments to send with the notification. Each attachments is an object like:

    • format: file format (i.e. pdf)

    • name: name of file

    • content: content of the file in Base64