WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 6 weeks ago

Last modified 5 weeks ago

#53065 closed enhancement (invalid)

wp_mail return values should be filterable

Reported by: shawfactor Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Mail Keywords: 2nd-opinion
Focuses: Cc:

Description

Firstly yes I know wp_amil is a pluggable function.

But right now having to overwrite thw whole function just to be bale to change the return value of wp_mail is not only overkill but limits ofrward compatibility of any code written.

I propose that the return values be filterable.

My ow use case is that ive built an email queue and filter wp_mail attaributes to force emails onto the queue. The problem this causes is that other plugins are saying that they emails are not sent (which is sort of true in the sense they are not sent right away, but are later)

A filter would overcome this problem and I am sure similar ones for other users

Change History (4)

#1 @desrosj
3 months ago

  • Component changed from General to Mail
  • Keywords 2nd-opinion added

Thanks for this ticket, @shawfactor!

I can't think of any problems this would cause at the moment. Though I would like to seek more feedback on this.

#2 @SergeyBiryukov
3 months ago

I think an example of how the new filter could be used would be helpful here.

Perhaps the existing pre_wp_mail filter might work for this use case?

#3 @shawfactor
6 weeks ago

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

I actually don’t think this is necessary, I raised it in error. I would appreciate someone looking at my other ticket though as I’ve more thoroughly looked at the code for that issue abs there is a problem

#4 @desrosj
5 weeks ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.