lib/ImapHelper.php
protected function searchSubjectAndPlainText($pattern, $message)
    {
        $matchesText = array();
        preg_match($pattern, $message['subject'], $matchesText);

        if (!empty($matchesText[1])) {
            return $matchesText[1];
        }

        $matchesSubject = array();
        preg_match($pattern, $message['plainText'], $matchesSubject);

        if (!empty($matchesSubject[1])) {
            return $matchesSubject[1];
        }

        return null;
    }
protected function searchSubjectAndPlainText($pattern, $message)
    {
        $matchesText = array();
        preg_match($pattern, $message['subject'], $matchesText);

        if (!empty($matchesText[1])) {
            return $matchesText[1];
        }

        $matchesSubject = array();
        preg_match($pattern, $message['plainText'], $matchesSubject);

        if (!empty($matchesSubject[1])) {
            return $matchesSubject[1];
        }

        return null;
    }
@param $pattern
@param $message

@return null