MessageBuilder::withText( string $text ): self

In this article

Adds text content to the message.

Parameters

$textstringrequired
The text to add.

Return

self

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

VersionDescription
0.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.