Build alternative plain text message
This public function provides the raw message for use in plain-text headers of HTML-formatted emails. If the user hasn't specified his own alternative message it creates one by stripping the HTML
string Core_Email::_get_alt_message( )
string
protected function _get_alt_message()
{
if ($this->alt_message !== '')
{
return $this->word_wrap($this->alt_message, '76');
}
$body = preg_match('/\<body.*?\>(.*)\<\/body\>/si', $this->_body, $match) ? $match[1] : $this->_body;
$body = str_replace("\t", '', preg_replace('#<!--(.*)--\>#', '', trim(strip_tags($body))));
for ($i = 20; $i >= 3; $i--)
{
$body = str_replace(str_repeat("\n", $i), "\n\n", $body);
}
return $this->word_wrap($body, 76);
}