public function getReminderEmailMessage($sub, $mime_boundary, $type = null) { $notify = new Cart66AdvancedNotifications(); $subId = isset($sub->id) ? $sub->id : null; if ($type == 'test') { if ($this->reminder_plain_email) { $plain_content = $this->reminder_plain_email; } else { $plain_content = $notify->getAdvancedEmailMessageContent('reminder', null, false, true, $this->id); } if ($this->reminder_html_email) { $html_content = $this->reminder_html_email; } else { $html_content = $notify->getAdvancedEmailMessageContent('reminder', null, true, true, $this->id); } } else { if ($this->reminder_plain_email) { $plain_content = strip_tags(str_replace('<br />', "\n", $notify->parseReceiptShortcodes($this->reminder_plain_email, $subId, 'plain', 'reminder'))); } else { $plain_content = $notify->getAdvancedEmailMessageContent('reminder', $subId, false, false, $this->id); } if ($this->reminder_html_email) { $html_content = $notify->parseReceiptShortcodes($this->reminder_html_email, $subId, 'html', 'reminder'); } else { $html_content = $notify->getAdvancedEmailMessageContent('reminder', $subId, true, false, $this->id); } } if ($type == 'cc') { $plain_content = "THIS IS A COPY OF THE EMAIL MESSAGE\n\n{$plain_content}"; $html_content = "THIS IS A COPY OF THE EMAIL MESSAGE<br /><br />{$html_content}"; } $sendHtml = false; if ($this->reminder_send_html_emails == 1) { $sendHtml = true; } $body = $notify->buildEmailBody($plain_content, $html_content, $mime_boundary, $sendHtml); if (CART66_WPMAIL) { if ($sendHtml) { $body = array('text/plain' => $plain_content, 'text/html' => $html_content); } else { $body = $plain_content; } } return $body; }