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

The no-deprecated filter is not always applied for preview messages #6065

Open
Genevieve-K opened this issue Oct 28, 2021 · 0 comments
Open
Assignees
Labels
keep-fresh "Keep Fresh" issues should not be marked as stale. type: bug Existing functionality is broken

Comments

@Genevieve-K
Copy link
Contributor

User Story

As a developper, I want to filter the default messages and see the result in the preview mode.

Details

Each email defines the default message in a function with two filters. The first one will deprecate soon, so I prefered to use the second filter.

For some emails ('new-donor-register', new-offline-donation' after issue #6063...), the function to define the default message is a class method named get_default_email_message().The init() function calls this function as a parameter to load(), so before the instance is loaded. And $this->config is not yet defined.

To apply the second filter, the hook name contains $this->config['id']}, that is not defined, and the hook name is give__get_default_email_message.

Suggested solution

Define default_email_message after the load:

$this->config['default_email_message'] = ( false !== give_get_option( 'new-offline-donation_email_message' ) ) ? give_get_option( 'new-offline-donation_email_message' ) : $this->get_default_email_message();

@Genevieve-K Genevieve-K added the type: bug Existing functionality is broken label Oct 28, 2021
@kjohnson kjohnson added the keep-fresh "Keep Fresh" issues should not be marked as stale. label Oct 17, 2022
@kjohnson kjohnson self-assigned this May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-fresh "Keep Fresh" issues should not be marked as stale. type: bug Existing functionality is broken
Projects
None yet
Development

No branches or pull requests

2 participants