logger->info( 'Start Sending Email Using WP Mail', $this->logger_context ); $send_mail = wp_mail( $message->to, $message->subject, $message->body, $message->headers, $message->attachments ); if ( ! $send_mail ) { global $phpmailer; if ( is_object( $phpmailer ) && $phpmailer->ErrorInfo ) { $message = wp_strip_all_tags( $phpmailer->ErrorInfo ); } else { $message = __( 'WP Mail Error: Unknown', 'email-subscribers' ); } return $this->do_response( 'error', $message ); } ES()->logger->info( 'Email Sent Successfully Using WP Mail', $this->logger_context ); return $this->do_response( 'success' ); } } }