Skip to content

Commit

Permalink
Merge branch 'release/2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jazz-Man committed Aug 17, 2023
2 parents 801becb + f90d488 commit b20df18
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/WPMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public function mail( ?bool $return = null, array $atts = [] ): bool {
$this->phpmailer->CharSet = apply_filters( 'wp_mail_charset', $this->charset );

return $this->phpmailer->send();

} catch ( Exception $errore ) {
$mail_error_data = compact( 'target', 'subject', 'message', 'headers', 'attachments' );
$mail_error_data['phpmailer_exception_code'] = $errore->getCode();
Expand All @@ -103,10 +102,9 @@ public function mail( ?bool $return = null, array $atts = [] ): bool {
*/
do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $errore->getMessage(), $mail_error_data ) );

if ( defined('WP_DEBUG') && WP_DEBUG ) {
if ( \defined( 'WP_DEBUG' ) && WP_DEBUG ) {
error_log( $errore );
}

}

return true;
Expand Down Expand Up @@ -177,7 +175,7 @@ private function init(): void {
}
}

private function addMailHeaders( array $headers ): void {
private function addMailHeaders( array|string $headers ): void {
$headers = $this->parseHeaders( $headers );

foreach ( $headers as $header => $content ) {
Expand Down

0 comments on commit b20df18

Please sign in to comment.