On this page
apply_filters( 'pre_wp_mail', null|bool $return, array $atts )
Filters whether to preempt sending an email.
Description
Returning a non-null value will short-circuit wp_mail() , returning that value instead. A boolean return value should be used to indicate whether the email was successfully sent.
Parameters
$returnnull|bool-
Short-circuit return value.
$attsarray-
Array of the
wp_mail()arguments.
tostring|string[]Array or comma-separated list of email addresses to send message.subjectstringEmail subject.messagestringMessage contents.headersstring|string[]Additional headers.attachmentsstring|string[]Paths to files to attach.
Source
File: wp-includes/pluggable.php. View all references
$pre_wp_mail = apply_filters( 'pre_wp_mail', null, $atts );
Related
Used By
| Used By | Description |
|---|---|
| wp_mail() wp-includes/pluggable.php | Sends an email, similar to PHP’s mail function. |
Changelog
| Version | Description |
|---|---|
| 5.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_wp_mail