Adds text content to the message.
Parameters
$textstringrequired- The text to add.
Source
public function withText(string $text): self
{
if (trim($text) === '') {
throw new InvalidArgumentException('Text content cannot be empty.');
}
$this->parts[] = new MessagePart($text);
return $this;
}
Changelog
| Version | Description |
|---|---|
| 0.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.