Gdn_Email::setFormat PHP Method

setFormat() public method

Sets the format property, the email mime type and the email template format property.
public setFormat ( string $format ) : Gdn_Email
$format string The format of the email. Must be in the $supportedFormats array.
return Gdn_Email
    public function setFormat($format)
    {
        if (strtolower($format) === 'html') {
            $this->format = 'html';
            $this->mimeType('text/html');
            $this->emailTemplate->setPlaintext(false);
        } else {
            $this->format = 'text';
            $this->mimeType('text/plain');
            $this->emailTemplate->setPlaintext(true);
        }
        return $this;
    }