Skip to content
Snippets Groups Projects
Select Git revision
  • 4932c63bc7408c7cf77d05defb1a5d9179f760e3
  • main default protected
  • devel
  • 1.0.0
4 results

MailerException.php

Blame
  • MailerException.php 441 B
    <?php
    
    declare( strict_types=1 );
    
    namespace WPDesk\Library\WPEmail\Exceptions;
    
    use RuntimeException;
    use WP_Error;
    
    class MailerException extends RuntimeException {
    
        public static function with_wp_error( WP_Error $error ): self {
            $errors  = $error->get_error_messages( 'wp_mail_failed' );
            $message = implode( "\n", $errors );
    
            return new self( sprintf( 'wp_mail() failure. Message [%s]', $message ) );
        }
    }