Set the email text

@param string $data

@return Parser MimeMailParser Instance
514946
public function setText($data)
    {
        if (empty($data)) {
            throw new Exception('You must not call MimeMailParser::setText with an empty string parameter');
        }

        if (substr($data, -1) != "\n") {
            $data = $data.PHP_EOL;
        }

        $this->resource = mailparse_msg_create();
        // does not parse incrementally, fast memory hog might explode
        mailparse_msg_parse($this->resource, $data);
        $this->data = $data;
        $this->parse();

        return $this;
    }
1351084
public function setData($data)
    {
        if (!is_array($data)) {
            throw new \InvalidArgumentException(sprintf('Messages custom data must be array, "%s" given.', gettype($data)));
        }

        if (array_key_exists("aps", $data)) {
            unset($data["aps"]);
        }

        foreach ($data as $key => $value) {
            $this->addCustomData($key, $value);
        }

        return $this;
    }
950340
public function setMessage($message)
    {
        if ( ! is_null($message)) $message = (string) $message;

        $this->setAttribute('message', $message);

        return $this;
    }
244840
public function withParsedBody($data)
    {
        $request = $this->copy();

        $request->parseCondition = ($data === null ? null : false);
        
        if ($this->shouldUsePostData() && $data !== null) {
            $request->postData = $data;
            $request->parsedBody = null;
        } else {
            $request->parsedBody = $data;
        }
        
        return $request;
    }
669576
public function setRawData(array $data) {

        $this->rawData = $data;

        if (isset($data['message'])) {
            $this->setMessage($data['message']);
        }

        return $this;

    }
1187330
public function setText($content, $charset = 'utf-8') {
        $this->text = $content;
        $this->textCharset = $charset;
        return $this;
    }
704158
protected function setText($email, Swift_Mime_Message $message)
	{
		foreach ($message->getChildren() as $attachment) {
			if (!$attachment instanceof Swift_MimePart) {
				continue;
			}
			$email->setText($attachment->getBody());
		}
	}
98619
public function setText( $text ) {
    $this->textOriginal = $text;
    $this->text = preg_replace("/([^\w ]*)/iu", "", $text);
    return $this;
  }
1218684
public function setCustomer($data = [])
    {
        if (array_key_exists('name', $data)) {
            $this->setCustomerName($data['name']);
        }

        if (array_key_exists('email', $data)) {
            $this->setCustomerEmail($data['email']);
        }

        if (array_key_exists('number', $data)) {
            $this->setCustomerMsisdn($data['number']);
        }

        if (array_key_exists('phone', $data)) {
            $this->setCustomerMsisdn($data['phone']);
        }

        if (array_key_exists('msisdn', $data)) {
            $this->setCustomerMsisdn($data['msisdn']);
        }

        return $this;
    }
1067285
public function setJson($data)
    {
        if (is_array($data)) {
            $this->_json = $data;
        } elseif (is_string($data)) {
            $this->_json = ['code' => 1, 'message' => $data];
        } elseif (is_int($data)) {
            $this->_json = ['code' => $data, 'message' => $this->getMessage()];
        } else {
            $this->_json = $data;
        }

        return $this;
    }
1212899
protected function setAttachment(&$data, Swift_Mime_SimpleMessage $message)
    {
        foreach ($message->getChildren() as $attachment) {
            if (!$attachment instanceof Swift_Attachment || !strlen($attachment->getBody()) > self::MAXIMUM_FILE_SIZE) {
                continue;
            }
            $handler = tmpfile();
            fwrite($handler, $attachment->getBody());
            $data['files[' . $attachment->getFilename() . ']'] = $handler;
        }
    }
910753
public HtmlEmailImpl setTextMsg(String aText) throws EmailException {
	if (StringUtil.isEmpty(aText)) {
	    throw new EmailException("Invalid message supplied");
	}
	this.text = aText;
	return this;
    }
192592
public function setResponseBody($data)
    {
        if (!is_string($data)) {
            $data = json_encode($data, \JSON_PRETTY_PRINT);
        }
        $this->response->getBody()->write($data);
        return $this;
    }
1036452
public function setMime($mime)
    {
        if (!empty($mime)) {
            $this->setContentType(
                Mime::getFullMime($mime)
            );
        }

        return $this;
    }
501043
protected function setData($data = [])
    {
        if (!isset($data[self::RS_KEY_CODE])) {
            $data[self::RS_KEY_CODE] = 0;
        }
        if (!isset($data[self::RS_KEY_MSG])) {
            $data[self::RS_KEY_MSG] = 'Success';
        }
        if (!isset($data[self::RS_KEY_TYPE])) {
            $data[self::RS_KEY_TYPE] = self::RESPONSE_XHTML;
        }

        if (!isset($data[self::RS_KEY_DATA])) {
            $data[self::RS_KEY_DATA] = new \stdClass();
        } else {
            if (!$data instanceof \stdClass) {
                $data[self::RS_KEY_DATA] = new \stdClass();
            }
        }
        $this->data = $data;
    }
174724
public function setText(string $text)
    {
        $this->resource = mailparse_msg_create();
        $eaten = 0;
        $text_length = strlen($text);
        while ($eaten < $text_length) {
            mailparse_msg_parse($this->resource, substr($text, $eaten, 2082));
            $eaten += 2082;
        }

        $this->text = $text;

        return $this;
    }
388000
public function withData($data): self
    {
        $new = clone $this;
        $new->data = $data instanceof MessageData ? $data : MessageData::fromArray($data);

        return $new;
    }