Problem

A notification channel that renders tokens (orchestra_easy_email) can only resolve Orchestra's own token types: [orchestra:*] (the instance) and [orchestra-notification:*] (the params). A dispatcher that wants a template to use its own domain tokens has no way to feed the data in without polluting process variables or overloading the notification params.

Proposed resolution

  • Add an optional tokenData parameter to OrchestraNotificationEvent: a map of token type to value/entity the dispatcher supplies.
  • The token-rendering channel (orchestra_easy_email) merges it into its token replacement data, with Orchestra's own token types keeping precedence on a key collision.
  • The params-only mail channel (orchestra_mail) does not render tokens, so it simply ignores tokenData.

This lets any *_notification module surface its own tokens in a template, for example a dispatcher passing ["node" => $node] so a template can use [node:title].

Remaining tasks

  • Kernel test coverage that a tokenData-supplied token resolves in the sent email.

Issue fork orchestra-3608937

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review
mably’s picture

Issue summary: View changes

  • mably committed 299bbeb0 on 1.x
    feat: #3608937 Let notifications carry token contexts (...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.