Package com.collibra.workflow.notifications.api.notification

# Interface NotificationApi

public interface NotificationApi
Notification API for sending structured notifications to the Notification Center.

Notifications are composed from building blocks (text, bold, italic, link, newLine) and delivered via email, UI, Slack, and Microsoft Teams. Translation keys (`textKey`) are resolved to the recipient's locale at send time. Custom translations can be added through the UI under Settings > General > Customizations > Custom Strings.

### Guardrails

The builder enforces the following limits silently (trim, don't fail) to ensure safe delivery across all channels:

- Literal text values: trimmed to 250 characters (with `...`)
- Translation key param values: trimmed to 250 characters each (with `...`)
- Translation key param count: limited to 10 per block
- Content blocks: limited to 20

Slack enforces a 3000-character limit on rendered output; content exceeding this is trimmed with an ellipsis.

### Recipient limits

The notifications API enforces maximum sizes on recipient lists (`userIds` and `userGroupIds`). These limits are not validated or trimmed by the builder — exceeding them will cause the request to be rejected by the API.

### Groovy usage example

     notification.send { builder -> builder
         .recipientUsers([userId1, userId2])
         .subject { s -> s.textKey("workflow.review.subject", assetName) }
         .content { c -> c
             .text { t -> t.textKey("workflow.review.intro", userName) }
             .newLine()
             .bold { t -> t.text(assetName) }
             .newLine()
             .link(assetUri) { t -> t.textKey("workflow.review.open") } }
         .resource(assetId, assetName, "ASSET")
     }

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `BEAN_NAME`
  The bean name under which this API is registered in the workflow script context.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `send(Consumer<NotificationBuilder> configurer)`
  Sends a structured notification using the builder DSL.

- ## Field Details

  - ### BEAN_NAME

    static final String BEAN_NAME
    The bean name under which this API is registered in the workflow script context.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### send

    void send(Consumer<NotificationBuilder> configurer)
    Sends a structured notification using the builder DSL.

    The consumer configures recipients, subject, content blocks, and an optional resource. The builder silently enforces guardrails (text trimming, block limits) before sending.

    Parameters:
      `configurer` - consumer that configures the `NotificationBuilder`