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

hook_civircm_alterMailParams parameter inconsistency

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7.27
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Needs Funding
    • Verified?:
      No
    • How it works currently:
      Mail parameters are passed through to civicrm_hook_alterMailParams with inconsistent names, subject to the mail context.
    • How it should work:
      Parameters should be passed through with consistent names across all mail contexts.

      Description

      I've stumbled across inconsistency in the $params payload passed through to civicrm_hook_alterMailParams. The documented keys from and replyTo are not consistently included in the $params.
       
      I've used Drupal's watchdog to capture the contents of $params in four different mail contexts: singleEmail, civimail, flexmailer and messageTemplate.
       
       
      For singleEmail and messageTemplate the hook looks to receive from and replyTo key/value pairs. civimail and flexmailer instead produce From and Reply-To key/value pairs.
       
       
       
      The hook documentation only refers to from and replyTo - https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterMailParams/

      Additional testing suggests that other $params key/value pairs are also inconsistent.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jtwyman John Twyman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: