Evaluate how 5.43 treats the extension's use of BAO_MessageTemplate and the alterMailParams hook
As per recent dev-digest.
Preliminary review:
-
For the hook, there's already a note in the code that the hook is called multiple times, so maybe it's already handling that well enough. Check what happens. -
We look up and create $contact['email_greeting_display']
and pass it with tplParams. Need to check:-
is this even needed - possibly there was no email greeting token at the time this was written? Can we just use the core token? Or does the core token do something weird? -
noting that if it were needed this isn't the same $contact as the $contact that is no longer being passed by core. The other one is when you do something like Find Contacts - Actions - Send Email. -
If we were to switch to the core one, need an upgrade script to update people's templates. Maybe this alone makes it not worth using the core one if there's no need.
-
-
Replace valueName with workflow_name. Note in the hook that won't be available until 5.43 so need to support both for a bit. -
Should it use civicrm_api3('MessageTemplate', 'send') instead of the BAO? Something else? -
Unit tests. There was some issue in the carrot environment with using delivery_method=email. Can't remember. Maybe it was just mink tests since CiviMailUtils should work for regular tests anywhere.
Edited by DaveD