Extend content array of hook_civicrm_alterMailContent
Overview
Extend $content
array of alterMailContent hook
Example use-case
More fields improve possibilities durign processing the hook.
Current behaviour
According to doc https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterMailContent/ the $content
array should have mailing_id field/index. However during sending mailings there are only 'html', 'text' and 'subject' indexes.
Proposed behaviour
The $content
is generated by CRM_Mailing_BAO_Mailing->getTemplates() method. This method should always adds more fields, like 'mailing_id' or 'campaign_id' which can be used during processing the hook.
Comments
This modification is used for altering urls with utm params, see https://github.com/WeMoveEU/utmaltor