do_action( 'wp_mail_succeeded', array $mail_data )
- Since
- 5.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 5.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, and attachments.
@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.
}$tostring[]Email addresses to send message.$subjectstringEmail subject.$messagestringMessage contents.$headersstring[]Additional headers.$attachmentsstring[]Paths to files to attach.
Where this hook fires · 1
wp-includes/pluggable.php:568wp_mail()
Source code
* @type string $subject Email subject. * @type string $message Message contents. * @type string[] $headers Additional headers. * @type string[] $attachments Paths to files to attach. * } */ 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.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 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.