wp_mail_succeeded
云策文档标注
概述
wp_mail_succeeded 是一个 WordPress 动作钩子,在 PHPMailer 成功发送邮件后触发。它主要用于通知开发者邮件发送过程已完成,但不保证收件人已成功接收。
关键要点
- 触发时机:PHPMailer 成功发送邮件后,即 send 方法无错误执行时。
- 参数:$mail_data 数组,包含收件人、主题、消息、头部和附件等信息。
- 注意事项:此钩子仅表示发送请求无错误,不保证邮件送达收件人。
- 相关函数:与 wp_mail() 函数关联,用于邮件发送流程。
- 版本引入:WordPress 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.
Parameters
$mail_dataarray-
An array containing the email recipient(s), subject, message, headers, and attachments.
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.
Source
do_action( 'wp_mail_succeeded', $mail_data );
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |