Mailgun\Messages\MessageBuilder::setTextBody PHP Method

setTextBody() public method

public setTextBody ( string $textBody ) : string
$textBody string
return string
    public function setTextBody($textBody)
    {
        if ($textBody == null || $textBody == '') {
            $textBody = ' ';
        }
        $this->message['text'] = $textBody;
        return $this->message['text'];
    }

Usage Example

 /**
  *
  * @return \Mailgun\Messages\MessageBuilder
  */
 protected function getMessageBuilder()
 {
     $htmlBody = $this->getVariable(static::CAPTURETO_HTML, false);
     $textBody = $this->getVariable(static::CAPTURETO_TEXT, false);
     if ($htmlBody !== false) {
         $this->mb->setHtmlBody($htmlBody);
     }
     if ($textBody !== false) {
         $this->mb->setTextBody($textBody);
     }
     return $this->mb;
 }
All Usage Examples Of Mailgun\Messages\MessageBuilder::setTextBody