Problem/Motivation
TokenProcessorTrait is a strange solution. As a trait, it interferes with the functions of the class it's used in, and they can't both act in the same phase. The class and trait end up sharing protected members, when there's really no need for it. They are forced to share the same weight.
Secondly, with the old mailsystem, tokens were almost always replaced prior to rendering. The token replacement occurred in hook_mail() and any rendering was only in the mail plug-in. It feels better, and potentially safer to match that if possible.
Proposed resolution
Convert the trait to a class TokenProcessor. Try to replace token at the end of the build phase if possible.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork symfony_mailer-3526980
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
Comment #2
adamps commentedComment #3
adamps commentedComment #6
adamps commentedComment #7
adamps commented