twomice / com.joineryhq.reltoken

CiviCRM extension: Provides tokens for any related contact, for all available contact tokens. E.g., to get the spouse's first name, or parent's marriage date.
Other
1 stars 5 forks source link

rewrite using Symfony token hooks and TokenProcessor #22

Closed MegaphoneJon closed 2 years ago

MegaphoneJon commented 2 years ago

Welp - someone had to do it eventually, right?

This is a rewrite of reltoken to use the newer Symfony token events, and use TokenProcessor to render tokens.

I added Flexmailer as a dependency because CiviMail without Flexmailer won't use the new Symfony events.

This is meant to be a rewrite following the original logic as closely as possible, and should have comparable performance. Now that we're using TokenProcessor I think we can render all tokens for a given related contact with a single TokenProcessor, which should yield a modest speed boost.

twomice commented 2 years ago

Wow, thanks @MegaphoneJon I've got this scheduled for review (and hopefully merging) on Monday.

twomice commented 2 years ago

Merged manually (with some changes) in cf2e2c118f84bf9317df09d16060e1dcc95ce780 and b788e456e029e640027b54392f2b5006884546c4 . Tagged in new version v0.4.0. Thanks @MegaphoneJon !