[wp-trac] [WordPress Trac] #35069: Allow short-circuiting wp_mail
WordPress Trac
noreply at wordpress.org
Mon Dec 14 09:29:11 UTC 2015
#35069: Allow short-circuiting wp_mail
----------------------------------------+--------------------------
Reporter: DvanKooten | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.5
Component: Mail | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses: performance
----------------------------------------+--------------------------
Comment (by swissspidy):
Thanks, makes sense.
The return value in the DocBlock would probably need to be reflect that
change:
{{{@return bool Whether the email contents were sent successfully.}}}
> One thing I'm in doubt over is the return value when short-circuiting.
Right now, I've set it to false but that's not ideal when queueing emails.
Perhaps a new filter could be used after the `wp_mail` filter?
`$mail_short_circuit = apply_filters( 'wp_mail_short_circuit', false, … )`
If `true`, it means the mail was successfully sent/scheduled by the
function hooking into that. `false` means proceed with using PHPMailer.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35069#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list