wp_mail_succeeded action-hookWP 5.9.0

Fires after PHPMailer has successfully sent an email.

The firing of this action does not necessarily mean that the recipient(s) received the email successfully. It only means that the send method above was able to process the request without any errors.

Usage

add_action( 'wp_mail_succeeded', 'wp_kama_mail_succeeded_action' );

/**
 * Function for `wp_mail_succeeded` action-hook.
 * 
 * @param array $mail_data An array containing the email recipient(s), subject, message, headers, and attachments.
 *
 * @return void
 */
function wp_kama_mail_succeeded_action( $mail_data ){

	// action...
}
$mail_data(array)

An array containing the email recipient(s), subject, message, headers, and attachments.

  • to(string[])
    Email addresses to send message.

  • subject(string)
    Email subject.

  • message(string)
    Message contents.

  • headers(string[])
    Additional headers.

  • attachments(string[])
    Paths to files to attach.

Changelog

Since 5.9.0 Introduced.

Where the hook is called

wp_mail()
wp_mail_succeeded
wp-includes/pluggable.php 569
do_action( 'wp_mail_succeeded', $mail_data );

Where the hook is used in WordPress

Usage not found.