do_action( 'wp_mail_succeeded', array $mail_data )
- Since
- 5.9.0, 6.9.0
Fires after PHPMailer has successfully sent an email.
Description
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.
Compatibility
- WordPress
- since 6.9.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$mail_dataarray- { An array containing the email recipient(s), subject, message, headers, attachments, and embeds.
@type string[] $to Email addresses to send message.
@type string $subject Email subject.
@type string $message Message contents.
@type string[] $headers Additional headers.
@type string[] $attachments Paths to files to attach.
@type string[] $embeds Paths to files to embed.
}$tostring[]Email addresses to send message.$subjectstringEmail subject.$messagestringMessage contents.$headersstring[]Additional headers.$attachmentsstring[]Paths to files to attach.$embedsstring[]Paths to files to embed.
Where this hook fires · 1
wp-includes/pluggable.php:651wp_mail()
Source code
* @type string $message Message contents. * @type string[] $headers Additional headers. * @type string[] $attachments Paths to files to attach. * @type string[] $embeds Paths to files to embed. * } */ do_action( 'wp_mail_succeeded', $mail_data ); return $send; } catch ( PHPMailer\PHPMailer\Exception $e ) { $mail_data['phpmailer_exception_code'] = $e->getCode(); /**Changelog
Introduced in 5.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.9.0
The
$embeds element was added to the $mail_data array.from the docblock5.9.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.