Mailgun\Messages\MessageBuilder::setHtmlBody PHP Method

setHtmlBody() public method

public setHtmlBody ( string $htmlBody ) : string
$htmlBody string
return string
    public function setHtmlBody($htmlBody)
    {
        if ($htmlBody == null || $htmlBody == '') {
            $htmlBody = ' ';
        }
        $this->message['html'] = $htmlBody;
        return $this->message['html'];
    }

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::setHtmlBody