Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #18439: Link set when create user are unusuable in text view #3335

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 14 additions & 4 deletions application/core/LimeMailer.php
Expand Up @@ -586,10 +586,7 @@ public function sendMessage()
$this->Body = "<html>" . $this->Body . "</html>";
}
$this->msgHTML($this->Body, App()->getConfig("publicdir")); // This allow embedded image if we remove the servername from image
if (empty($this->AltBody)) {
$html = new \Html2Text\Html2Text($this->Body);
$this->AltBody = $html->getText();
}
// TODO: Original AltBody is overwritten by msgHTML. Do we need to set it again if there was one?
Shnoulle marked this conversation as resolved.
Show resolved Hide resolved
}
return $this->Send();
}
Expand Down Expand Up @@ -988,4 +985,17 @@ public static function validateAddresses($aEmailAddressList, $patternselect = nu
}
return $aOutList;
}

/**
* @inheritdoc
* Override to use a better html to text converter (ex. doesn't removes links)
*/
public function html2text($html, $advanced = false)
{
if (is_callable($advanced)) {
return call_user_func($advanced, $html);
}

return (new \Html2Text\Html2Text($html))->getText();
}
}