mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
add support for sending html mails
This commit is contained in:
parent
2f2472f79f
commit
686a6b3ab7
|
@ -114,17 +114,47 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify {
|
|||
}
|
||||
|
||||
|
||||
$message = '';
|
||||
if(!isset($params['__skip_header__']) || !$params['__skip_header__'])
|
||||
$message .= getMLText("email_header", $params, "", $lang)."\r\n\r\n";
|
||||
$message .= getMLText($messagekey, $params, "", $lang);
|
||||
if(!isset($params['__skip_footer__']) || !$params['__skip_footer__'])
|
||||
$message .= "\r\n\r\n".getMLText("email_footer", $params, "", $lang);
|
||||
$body = '';
|
||||
if(!isset($params['__skip_header__']) || !$params['__skip_header__']) {
|
||||
if(!isset($params['__header__']))
|
||||
$body .= getMLText("email_header", $params, "", $lang)."\r\n\r\n";
|
||||
elseif($params['__header__'])
|
||||
$body .= getMLText($params['__header__'], $params, "", $lang)."\r\n\r\n";
|
||||
}
|
||||
if(!isset($params['__body__']))
|
||||
$body .= $params['__body__'];
|
||||
else
|
||||
$body .= getMLText($messagekey, $params, "", $lang);
|
||||
if(!isset($params['__skip_footer__']) || !$params['__skip_footer__']) {
|
||||
if(!isset($params['__footer__']))
|
||||
$body .= "\r\n\r\n".getMLText("email_footer", $params, "", $lang);
|
||||
elseif($params['__footer__'])
|
||||
$body .= "\r\n\r\n".getMLText($params['__footer__'], $params, "", $lang);
|
||||
}
|
||||
|
||||
$bodyhtml = '';
|
||||
if(!isset($params['__skip_header__']) || !$params['__skip_header__']) {
|
||||
if(!isset($params['__header_html__']))
|
||||
$body .= getMLText("email_header", $params, "", $lang)."\r\n\r\n";
|
||||
elseif($params['__header_html__'])
|
||||
$body .= getMLText($params['__header_html__'], $params, "", $lang)."\r\n\r\n";
|
||||
}
|
||||
if(!isset($params['__body_html__']))
|
||||
$body .= $params['__body_html__'];
|
||||
else
|
||||
$body .= getMLText($messagekey.'_html', $params, "", $lang);
|
||||
if(!isset($params['__skip_footer__']) || !$params['__skip_footer__']) {
|
||||
if(!isset($params['__footer_html__']))
|
||||
$body .= "\r\n\r\n".getMLText("email_footer", $params, "", $lang);
|
||||
elseif($params['__footer_html__'])
|
||||
$body .= "\r\n\r\n".getMLText($params['__footer_html__'], $params, "", $lang);
|
||||
}
|
||||
|
||||
$mime = new Mail_mime(array('eol' => "\n"));
|
||||
|
||||
$mime->setTXTBody($message);
|
||||
// $mime->setHTMLBody($bodyhtml);
|
||||
$mime->setTXTBody($body);
|
||||
if($bodyhtml)
|
||||
$mime->setHTMLBody($bodyhtml);
|
||||
|
||||
if($attachments) {
|
||||
foreach($attachments as $attachment) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user