BP_Reply_By_Email_Parser::__construct PHP Méthode

__construct() public méthode

Constructor.
public __construct ( array $args = [], $i = 1 )
$args array { An array of arguments. @type array $headers Email headers. @type string $to_email The 'To' email address. @type string $from_email The 'From' email address. @type string $content The email body content. @type string $subject The email subject line. @type bool $html Whether the email content is HTML or not. }
    public function __construct($args = array(), $i = 1)
    {
        // headers check
        if (!empty($args['headers'])) {
            self::$headers = self::validate_headers((array) $args['headers'], $i);
        }
        // get querystring
        if (!empty($args['to_email'])) {
            self::$querystring = self::get_querystring($args['to_email']);
        }
        // get userdata from email address
        if (!empty($args['from_email'])) {
            self::$user = get_user_by('email', $args['from_email']);
        }
        // set email content
        if (!empty($args['content'])) {
            self::$content = $args['content'];
        }
        // set email subject
        if (!empty($args['subject'])) {
            // Strip line-breaks from subject lines.
            self::$subject = str_replace("\r\n", '', $args['subject']);
        }
        // is the current email HTML-only?
        if (isset($args['is_html'])) {
            self::$is_html = (bool) $args['is_html'];
        }
    }