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

$return

Short-circuit return value.

$atts

Array of the wp_mail() arguments.<br>

  • 'to'
    (string|string[]) Array or comma-separated list of email addresses to send message.<br>
  • 'subject'
    (string) Email subject.<br>
  • 'message'
    (string) Message contents.<br>
  • 'headers'
    (string|string[]) Additional headers.<br>
  • 'attachments'
    (string|string[]) Paths to files to attach.<br>


Source

File: wp-includes/pluggable.php

View on GitHub



Changelog

Changelog
Version Description
5.7.0 Introduced.