Skip to content

Reimplement token processor

JonGold requested to merge JonGold/emailapi:token-processor into master

In Email API 2.0, @mattwire wrote code to support the new TokenProcessor, which was removed in Email API 2.5 because it was the source of some bugs.

I reviewed the old code, and it was long and complicated, because TokenProcessor only worked in limited circumstances at the time and we needed to handle exceptions. However, with Civi 5.43+, this is no longer true. I was able to reimplement TokenProcessor in a way that reduces code, increases performance, is simpler to read, and is more forward-compatible.

It would be great to get some additional testing - particularly on entities besides contributions, which is my main use case. And if others would help, I would really like to get some unit tests together to test multiple scenarios.

Merge request reports

Loading