/**
* Table Definition for core_email
*/
-require_once 'DB/DataObject.php';
+class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php';
class Pman_Core_DataObjects_Core_email extends DB_DataObject
{
function applyFilters($q, $au, $roo)
{
- DB_DataObject::debugLevel(1);
-
$tn = $this->tableName();
if(!empty($q['search']['nameortitle'])){
'contents' => $contents,
'css_embed' => true, // we should always try and do this with emails...
);
+
if (isset($contents['rcpts'])) {
$cfg['rcpts'] = $contents['rcpts'];
}
+
+ if (isset($contents['attachments'])) {
+ $cfg['attachments'] = $contents['attachments'];
+ }
+
if (isset($contents['mailer_opts']) && is_array($contents['mailer_opts'])) {
$cfg = array_merge($contents['mailer_opts'], $cfg);
}
-
$r = new Pman_Core_Mailer($cfg);
$imageCache = session_save_path() . '/email-cache-' . $ui['name'] . '/mail/' . $this->tableName() . '-' . $this->id . '-images.txt';
fwrite($fh, implode("\n", array(
"From: {if:t.messageFrom}{t.messageFrom:h}{else:}{t.messageFrom():h}{end:}",
"To: {if:t.person}{t.person.getEmailFrom():h}{else:}{rcpts:h}{end:}",
- "Subject: {t.subject} ",
+ "Subject: {t.subject:h} ",
"X-Message-ID: {t.id} ",
"{if:t.replyTo}Reply-To: {t.replyTo:h}{end:}",
"{if:t.mailgunVariables}X-Mailgun-Variables: {t.mailgunVariables:h}{end:}"