Consolidate building of contact token list #21429
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Consolidate building of contact token list
Before
Code to derive a list of tokens for the
TokenCompatProcessor
was not available toTokenCompatProcessor
- the actual processing has been almost entirely moved to the class (replaceGreetingTokens
being a stand-out resister)After
list of contact tokens now rendered from the class
Technical Details
Since there are no existing places this is called from I kept the
isActive
logic very simple - at least for now.I'm double checking this - but it seemed to render Individual & contact tokens but not other subtypes
The generation of the list of tokens was derived through long and convuled code and did not map to the contact entity's fields since there are other entities involved - so I just hard-coded it. This has the advantage of allowing us to visually check in on it as we fix the other issues in this class.
Comments
I put up the test cover separately here #21427 to demonstrate it passes before this change too....