本文整理汇总了PHP中SugarPHPMailer::replaceImageByRegex方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarPHPMailer::replaceImageByRegex方法的具体用法?PHP SugarPHPMailer::replaceImageByRegex怎么用?PHP SugarPHPMailer::replaceImageByRegex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarPHPMailer
的用法示例。
在下文中一共展示了SugarPHPMailer::replaceImageByRegex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleBodyInHTMLformat
/**
* Retrieve function from handlebody() to unit test easily
* @param SugarPHPMailer $mail SugarPHPMailer instance
* @return formatted $mail body
*/
function handleBodyInHTMLformat($mail)
{
global $sugar_config;
// wp: if body is html, then insert new lines at 996 characters. no effect on client side
// due to RFC 2822 which limits email lines to 998
$mail->IsHTML(true);
$body = from_html(wordwrap($this->description_html, 996));
$mail->Body = $body;
// cn: bug 9725
// new plan is to use the selected type (html or plain) to fill the other
$plainText = from_html($this->description_html);
$plainText = strip_tags(br2nl($plainText));
$mail->AltBody = $plainText;
$this->description = $plainText;
$mail->replaceImageByRegex("(?:{$sugar_config['site_url']})?/?cache/images/", sugar_cached("images/"));
//Replace any embeded images using the secure entryPoint for src url.
$mail->replaceImageByRegex("(?:{$sugar_config['site_url']})?/?index.php[?]entryPoint=download&(?:amp;)?[^\"]+?id=", "upload://", true);
$mail->Body = from_html($mail->Body);
}