• File: EmailReplyParser.php
  • Full Path: /var/www/crm_set/application/vendor/willdurand/email-reply-parser/src/EmailReplyParser/EmailReplyParser.php
  • Date Modified: 09/21/2026 4:19 AM
  • File size: 805 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

/**
 * This file is part of the EmailReplyParser package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @license    MIT License
 */

namespace EmailReplyParser;

use EmailReplyParser\Parser\EmailParser;

/**
 * @author William Durand <william.durand1@gmail.com>
 */
class EmailReplyParser
{
    /**
     * @param string $text An email as text.
     *
     * @return Email
     */
    public static function read($text)
    {
        $parser = new EmailParser();

        return $parser->parse($text);
    }

    /**
     * @param string $text An email as text.
     *
     * @return string
     */
    public static function parseReply($text)
    {
        return static::read($text)->getVisibleText();
    }
}