Check if the latest email received has the $textBody.

@param $textBody

@return mixed
160316
public function receiveAnEmailWithTextBody($textBody)
    {
        $message = $this->fetchLastMessage();
        $this->assertEquals($textBody, $message->text_body);
    }
926498
public function reply ($message) {
		// Make sure we actually have a text to reply to
		if (!$this->inbound_message) {
			return false;
		}

		return $this->sendText($this->from, $this->to, $message);
	}
1239660
public function lastInsertId()
    {
        if ($this->isConnected()) {
            try {
                return $this->pdo->lastInsertId();
            } catch (PDOException $e) {
                throw new \Exception($e->getMessage());
                return false;
            }
        } else {
            return false;
        }
    }
660595
public function body($text)
    {
        try {
            $this->mailer->MsgHTML($text);
        } catch (phpmailerException $e) {
            throw new EmailException($e->getMessage(), $e->getCode());
        }

        return $this;
    }
649791
public function hasNext()
    {
        $cursor = $this;
        return $this->retry(function() use ($cursor) {
            return $cursor->getRiakCursor()->hasNext();
        }, false);
    }
907383
public function get_imap(){
    if ( $this->imap = imap_check($this->stream) ){
      if ( $this->imap->Nmsgs > 0 ){
        $this->last_uid = $this->get_msg_uid($this->imap->Nmsgs);
        $this->num_msg = $this->imap->Nmsgs;
      }
      else {
        $this->last_uid = 0;
        $this->num_msg = 0;
      }
      return $this->imap;
    }
    return false;
  }
67111
public function getBodyText($id = 0, $stream = false)
    {
        return $this->_msgText(
            $stream,
            isset($this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id])
                ? $this->_data[Horde_Imap_Client::FETCH_BODYTEXT][$id]
                : null
        );
    }
380089
public function compileHtmlBody(string $textBody): string
    {
        $html = Html::encode($textBody);
        $html = Markdown::process($html);

        return $html;
    }
628537
public function hasMx($email)
    {
        if (! $this->isEmail($email)) {
            return null;
        }

        $hostname = $this->hostnameFromEmail($email);

        if ($hostname) {
            return checkdnsrr($hostname, 'MX');
        }

        return null;
    }
888623
public function findEmailsToSend($limit = null)
    {
        $qb = $this->createQueryBuilder('se')
            ->where('se.status = :status AND (se.sentAt IS NULL OR se.sentAt <= :sentAt)')
            ->orderBy('se.sentAt', 'ASC')
            ->setParameter('status', SpoolEmailStatus::STATUS_WAITING)
            ->setParameter('sentAt', new \DateTime())
        ;

        if ($limit > 0) {
            $qb->setMaxResults($limit);
        }

        return $qb->getQuery()->getResult();
    }
161236
protected function reply(string $text = null): PendingReply
    {
        return (new PendingReply(
            context()->getChannel(),
            context()->getChat(),
            context()->getUser()
        ))->text($text);
    }
977468
protected function renderTextBody($body)
    {
        $body = html_entity_decode(
            trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s', '', $body))), ENT_QUOTES
        );

        if (empty($body)) {
          $body = 'To view this email, open it an email client that supports HTML.';
        }

        return $body;
    }
1269877
public function detect_emails()
	{
		$this->loop_text_nodes(function($child) {
			preg_match_all("/(?:[a-zA-Z0-9\-\._]){1,}@(?:[a-zA-Z0-9\-\.]{1,255}\.[a-zA-Z]{1,20})/",
				$child->get_text(),
				$matches,
				PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);

			if(count($matches[0]) == 0)
				return;

			$replacment = array();
			$last_pos   = 0;

			foreach($matches[0] as $match)
			{
				$url      = new Node_Container_Tag('email', array());
				$url_text = new Node_Text($match[0]);
				$url->add_child($url_text);

				$replacment[] = new Node_Text(substr($child->get_text(), $last_pos, $match[1] - $last_pos));
				$replacment[] = $url;
				$last_pos = $match[1] + strlen($match[0]);
			}

			$replacment[] = new Node_Text(substr($child->get_text(), $last_pos));
			$child->parent()->replace_child($child, $replacment);
		}, $this->get_excluded_tags(BBCode::AUTO_DETECT_EXCLUDE_EMAIL));

		return $this;
	}
776767
public function getEmailSubject() : string
    {
        $result = sprintf(
            '%s: %s',
            Inflector::singularize($this->table->getAlias()),
            $this->getDisplayValue()
        );

        if (! $this->entity->isNew()) {
            $result = sprintf('(Updated) %s', $result);
        }

        return $result;
    }
640946
public function waitForEmailWithTextInHTMLBody($text, $timeout = 5)
    {
        $condition = function () use ($text) {
            $emails = $this->fetchMessages();
            foreach ($emails as $email) {
                $constraint = Assert::stringContains($text);
                if ($constraint->evaluate($email->html_body, '', true)) {
                    return true;
                }
            }

            return false;
        };

        $message = sprintf('Waited for %d secs but no email with the html body containing %s has arrived', $timeout,
            $text);

        $this->wait($timeout)->until($condition, $message);
    }
625166
public function parse($body)
    {
        $responseClass = $this->responseHandler;
        $response = new $responseClass();
        $response->setCommand($this);
        $response->setBody($body);
        return $response->parse();
    }
192069
public function getPrevious($text = '&laquo;')
	{
		// If the current page is less than or equal to one, it means we can't go any
		// further back in the pages, so we will render a disabled previous button
		// when that is the case. Otherwise, we will give it an active "status".
		if ($this->currentPage <= 1)
		{
			return $this->getDisabledTextWrapper($text);
		}
		else
		{
			$url = $this->paginator->getUrl($this->currentPage - 1);

			return $this->getPageLinkWrapper($url, $text);
		}
	}