diff --git a/notifications/inc/class.notifications_email.inc.php b/notifications/inc/class.notifications_email.inc.php index ca8ddd86c7..2f0c276851 100644 --- a/notifications/inc/class.notifications_email.inc.php +++ b/notifications/inc/class.notifications_email.inc.php @@ -97,15 +97,25 @@ class notifications_email implements notifications_iface { $this->mail->FromName = $this->sender->account_fullname; $this->mail->Subject = $_subject; //error_log(__METHOD__.__LINE__.array2string($_attachments)); + $isMeetingRequestNotif = false; if ($_attachments && stripos($_attachments[0]->type,"text/calendar; method=")!==false) { $this->mail->AltExtended = $_attachments[0]->string; $this->mail->AltExtendedContentType = $_attachments[0]->type; unset($_attachments[0]); + $isMeetingRequestNotif = true; + } + // do not send html part if this is a meeting request notification + $this->mail->IsHTML(($isMeetingRequestNotif?false:true)); + if ($isMeetingRequestNotif===false) + { + $this->mail->Body = $body_html; + $this->mail->AltBody = $body_plain; + } + else + { + $this->mail->Body = $body_plain; } - $this->mail->IsHTML(true); - $this->mail->Body = $body_html; - $this->mail->AltBody = $body_plain; if(is_array($_attachments) && count($_attachments) > 0) { foreach($_attachments as $attachment)