Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2020-09-27 10:34:52 +02:00
commit 12e85f66c3

View File

@ -76,10 +76,14 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify {
* @param string $message key of string containing the body of the mail
* @param array $params list of parameters which replaces placeholder in
* the subject and body
* This may contain the special keys
* __lang__: use this language for the email
* __skip_header__: do not include the standard body header
* __skip_footer__: do not include the standard body footer
* @param array $attachments list of attachments
* @return false or -1 in case of error, otherwise true
*/
function toIndividual($sender, $recipient, $subject, $message, $params=array(), $attachments=array()) { /* {{{ */
function toIndividual($sender, $recipient, $subject, $messagekey, $params=array(), $attachments=array()) { /* {{{ */
if(is_object($recipient) && !strcasecmp(get_class($recipient), $this->_dms->getClassname('user')) && !$recipient->isDisabled() && $recipient->getEmail()!="") {
$to = $recipient->getEmail();
$lang = $recipient->getLanguage();
@ -107,8 +111,12 @@ class SeedDMS_EmailNotify extends SeedDMS_Notify {
}
$message = getMLText("email_header", $params, "", $lang)."\r\n\r\n".getMLText($message, $params, "", $lang);
$message .= "\r\n\r\n".getMLText("email_footer", $params, "", $lang);
$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);
$mime = new Mail_mime(array('eol' => "\n"));