Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is possible to exclude certain addresses from a mime message. To do so, you can use the custom header x-pipeforce-exclude-addresses es and specify the addresses to be excluded. For example:

Code Block
pipeline:
  - notification.send:
      input: {
          "headers": {
            "x-pipeforce-exclude-addresseses": ["$uri:group:vacation"]
            "to":   ["$uri:group:sales"],
            "subject": "New lead",
          }
          "body": {
              "contentType": "text/plain",
              "content": "Hi, a new lead was created."
            }
        }

...

  • It will look for a query param ?locale=<lang> in each address.
    For example: $uri:email:foo@bar.tld?locale=de. If no locale exists it will use en as default.

  • If the address is an IAM address like $uri:group: or $uri:user: it will use the value of user attribute locale from IAM for the locale if exists. Otherwise, it will fallback to en as default. If both are given (query param and locale attribute in IAM), the query param will have precedence.

  • It will split a notification to multiple notifications for each new language and will manage to split also addresses according to these languages. For example if there are these TO addresses set: $uri:email:my@mail.tld?locale=de, $uri:email:another@mail.tld?locale=en this means two emails will be rendered and send: One with de as language with german text in subject and body and one with english text. Finally, there will be two emails: The DE one is sent to my@mail.tld and the EN one sent to another@mail.tld. The same is true for addresses in CC and BCC.

  • Any $uri:template, $uri:property or $uri:pipeline which is used in subject and body of the notification will automatically be suffixed with the selected locale. So for example $uri:template:mytemplate will become $uri:template:mytemplate_de in case the locale is set to ?locale=de via address query param or IAM. This way different templates can be provided in the property store and the notification framework will pick-up the one which belongs to the selected language.

Multi-Channel Notifications

The notification framework also supports sending a notification to different channels. This way it is possible beside via email, the same notification can be send to a Slack channel, via SMS and Teams for example. For each channel, different templates can be provided in order to adjust the format of the message so it fits the target channel.

How to enable it

In order to enable multi-channel support, you have to Additionally, the detected language will be set as Content-Lang header (which is a standard MIME header) so it can be used in the templates and/or at target client side as well.

Static suffix / disable suffixing

In some situations, suffixing the template resource path is not wanted or a static suffix must be used for all of such resources. For this, you can set the header x-pipeforce-multilang-multichannelsuffix to true.

How it works

If multi-channel support is enabled, the framework will handle a notification similar to the multi-language approach:

  • It will look for the final addresses in the address uri. For example:

    • $uri:email: → email channel

    • $uri:slack: → slack channel

    • $uri:teams: → teams channel

    • $uri:sms → sms channel

    • aso.

  • It will split a single notification to multiple notification messages: For each new channel and will manage to split also addresses according to these channels. For example if there are these TO addresses set: $uri:email:my@mail.tld?locale=de, $uri:slack:mygroup this means two notifications will be rendered and send: One as email and the other one as Slack message. The same is true for addresses in CC and BCC.

  • Any $uri:template, $uri:property or $uri:pipeline which is used in subject and body of the notification will automatically be suffixed with the selected channel. So for example $uri:template:mytemplate will become $uri:template:mytemplate_slack in case the channel is set to slack via address. This way, different templates can be provided in the property store and the notification framework will pick-up the one which belongs to the selected channel.

...

a static suffix. If this is set, it will be used and the calculated suffixes from the language (for example _en) will be ignored.

In case you don’t want to use suffixes at all, set this header to empty string "". Then, always the template resource without suffix will be loaded. You can then add language specific logics inside your template by using the Content-Lang header which is also provided into the template.

Multi-Channel Notifications

The notification framework also supports sending a notification to different channels. This way it is possible beside via email, the same notification can be send to a Slack channel, via SMS and Teams for example. For each channel, different templates can be provided in order to adjust the format of the message so it fits the target channel.

How to enable it

In order to enable multi-channel support, you have to set the header x-pipeforce-multichannel to true.

How it works

If multi-channel support is enabled, the framework will handle a notification similar to the multi-language approach:

  • It will look for the final addresses in the address uri. For example:

    • $uri:email: → email channel

    • $uri:slack: → slack channel

    • $uri:teams: → teams channel

    • $uri:sms → sms channel

    • aso.

  • It will split a single notification to multiple notification messages: For each new channel and will manage to split also addresses according to these channels. For example if there are these TO addresses set: $uri:email:my@mail.tld?locale=de, $uri:slack:mygroup this means two notifications will be rendered and send: One as email and the other one as Slack message. The same is true for addresses in CC and BCC.

  • Any $uri:template, $uri:property or $uri:pipeline which is used in subject and body of the notification will automatically be suffixed with the selected channel. So for example $uri:template:mytemplate will become $uri:template:mytemplate_slack in case the channel is set to slack via address. This way, different templates can be provided in the property store and the notification framework will pick-up the one which belongs to the selected channel.

Additionally, the detected channel will be set as x-pipeforce-channel header so it can be used in the templates as well.

Info

In case both multi-lang and multi-channel are enabled for the notification, the channel name and the selected locale will be suffixed as _<channel>_<locale>. For example $uri:template:mytemplate becomes $uri:template:mytemplate_slack_de in case the detected channel from address is slack and the detected language is de. This way you can create template specific to channel + language.

Static suffix / disable suffixing

In some situations, suffixing the template resource path is not wanted or a static suffix must be used for all of such resources. For this, you can set the header x-pipeforce-multichannel-suffix to a static suffix. If this is set, it will be used and the calculated suffixes from the channel (for example _email) will be ignored.

In case you don’t want to use suffixes at all, set this header to empty string "". Then, always the template resource without suffix will be loaded. You can then add channel specific logics inside your template by using the x-pipeforce-channel header which is also provided into the template.

Push Notifications

Push notifications are system and business events, a user can subscribe to. Any time there is a match, such an event is automatically converted to a notification and will be send to the registered user's preferred communication channels like email or chat group for example.

...

  • to: A list of addresses, to send the push notification to.

  • cc: A list of addresses, to send the push notification to in CC.

  • bcc: A list of addresses, to send the push notification to in BCC.

  • subject: The subject to be used for the push notification. If no subject is set, a default subject is generated.

  • x-pipeforce-exclude-addresseses: A list of addresses to exclude from the push notification.

...