Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20140

CiviCRM alterMailParams hook does not work on subject

    Details

    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      When trying to use civicrm hook_civicrm_alterMailParams to alter the email subject (e.g : replace custom tokens) , nothing will happen and your modifications to the mail subject will not have any affect on the sent email.

        1. The problem in action

      if your myextension.php file contain this :

      function myextension_civicrm_alterMailParams(&$params, $context) {
        $params['Subject'] = 'aaa';
        $params['html'] = 'aaa';
      }
      

      and no matter what the original email subject and body is , you should recienve an email with subject 'aaa' and body 'aaa' but what you will actually get is an email with only body = 'aaa' and the subject will equal the original assgined to it from UI.

      This PR fixes this so in the case above you will have both subject and body = 'aaa'

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              omarabuhussein omar abu hussein
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: