Skip to:
Content

BuddyPress.org

Opened 7 weeks ago

Closed 7 weeks ago

#9169 closed defect (bug) (fixed)

Correct behavior of bp_email_set_content_type filter.

Reported by: dcavins's profile dcavins Owned by: djpaul's profile DJPaul
Milestone: 14.0.0 Priority: normal
Severity: normal Version: 12.5.0
Component: Emails Keywords: has-patch commit
Cc:

Description

Attempting to change the email type for all emails (from the default html type to plaintext) via the bp_email_set_content_type filter is not working. If an email is created, and the method set_content_type() is not run, the filter will not be invoked.

Reported by @vapvarun.

Attachments (1)

9169.1.diff (2.5 KB) - added by dcavins 7 weeks ago.
Ensure that bp_email_set_content_type filter is run.

Download all attachments as: .zip

Change History (5)

#1 @dcavins
7 weeks ago

This patch sets the email type explicitly when the BP_Email is constructed. This ensures that the filter is run. It is possible to still set the type after instantiation using the set_content_type() method.

I've added several tests to ensure that the various combinations work.

@dcavins
7 weeks ago

Ensure that bp_email_set_content_type filter is run.

This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.


7 weeks ago

#3 @imath
7 weeks ago

  • Keywords commit added

Looks good 👍 Thanks a lot for your work on it! Feel free to commit it.

#4 @dcavins
7 weeks ago

  • Resolution set to fixed
  • Status changed from new to closed

In 13905:

Ensure that bp_email_set_content_type filter is run.

This patch sets the email type explicitly when the BP_Email class is constructed. This ensures that
the filter is run.

It is still possible to set the type after
instantiation using the set_content_type() method.

Props vapvarun.

Fixes #9169.

Note: See TracTickets for help on using tickets.