Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1253 Pass mailing id to alterMailContent hook #15306

Merged
merged 1 commit into from
Jan 10, 2020
Merged

#1253 Pass mailing id to alterMailContent hook #15306

merged 1 commit into from
Jan 10, 2020

Conversation

bhahumanists
Copy link
Contributor

https://lab.civicrm.org/dev/core/issues/1253

Overview

Passes through the mailing ID to alterMailContent hook

Before

The hook can't figure out anything about the mailing that the content is part of.

After

The hook has access to data about the mailing that the content is part of.

Technical Details

If the PR introduces noteworthy technical changes, please describe them here. Provide code snippets if necessary

Comments

Anything else you would like the reviewer to note

@civibot
Copy link

civibot bot commented Sep 13, 2019

(Standard links)

@civibot civibot bot added the master label Sep 13, 2019
@totten
Copy link
Member

totten commented Sep 14, 2019

This seems like a good idea.

I double-checked (by reading code) to see if this would be provided consistently in different cases where h_c_alterMailContent fires:

  • 👍 Traditional BAO mailer and Flexmailer both load templates through CRM_Mailing_BAO_Mailing::getTemplates(), so it should fire the same way in either case.
  • ⚠️ CRM_Core_BAO_MessageTemplate also fires h_c_alterMailContent. The mailingID wouldn't make sense in that case.

It would make sense to update the docs (https://github.com/civicrm/civicrm-dev-docs/blob/master/docs/hooks/hook_civicrm_alterMailContent.md) to indicate that mailingID and messageTemplateID are only provided under certain circumstances.

@mattwire
Copy link
Contributor

@bhahumanists Please can you create a docs PR https://github.com/civicrm/civicrm-dev-docs/pulls and then link to it here. Once that's done we can merge this PR.

@bhahumanists
Copy link
Contributor Author

Done: civicrm/civicrm-dev-docs#703

@homotechsual
Copy link
Contributor

Docs PR is approved for merge with core release.

@homotechsual
Copy link
Contributor

@mattwire you can remove needs-documentation label from this - docs PR is good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master merge ready PR will be merged after a few days if there are no objections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants