Changeset 52083
- Timestamp:
- 11/09/2021 10:25:40 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r52065 r52083 538 538 do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); 539 539 540 $mail_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' ); 541 540 542 // Send! 541 543 try { 542 return $phpmailer->send(); 544 $send = $phpmailer->send(); 545 546 /** 547 * Fires after PHPMailer has successfully sent a mail. 548 * 549 * The firing of this action does not necessarily mean that the recipient received the 550 * email successfully. It only means that the `send` method above was able to 551 * process the request without any errors. 552 * 553 * @since 5.9.0 554 * 555 * @param array $mail_data An array containing the mail recipient, subject, message, headers, and attachments. 556 */ 557 do_action( 'wp_mail_succeeded', $mail_data ); 558 559 return $send; 543 560 } catch ( PHPMailer\PHPMailer\Exception $e ) { 544 545 $mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' ); 546 $mail_error_data['phpmailer_exception_code'] = $e->getCode(); 561 $mail_data['phpmailer_exception_code'] = $e->getCode(); 547 562 548 563 /** … … 554 569 * containing the mail recipient, subject, message, headers, and attachments. 555 570 */ 556 do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_ error_data ) );571 do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_data ) ); 557 572 558 573 return false;
Note: See TracChangeset
for help on using the changeset viewer.