/** * Assigns values to e-mail parameters. * @param $paramArray array * @return void */ function assignParams($paramArray = array()) { // Add commonly-used variables to the list $site =& Request::getSite(); $paramArray['principalContactSignature'] = $site->getLocalizedSetting('contactName'); return parent::assignParams($paramArray); }
/** * Send the email. * Aside from calling the parent method, this actually attaches * the persistent attachments if they are used. * @param $clearAttachments boolean Whether to delete attachments after */ function send($clearAttachments = true) { if (isset($this->journal)) { //If {$templateSignature} exists in the body of the // message, replace it with the journal signature; // otherwise just append it. This is here to // accomodate MIME-encoded messages or other cases // where the signature cannot just be appended. $searchString = '{$templateSignature}'; if (strstr($this->getBody(), $searchString) === false) { $this->setBody($this->getBody() . "\n" . $this->journal->getSetting('emailSignature')); } else { $this->setBody(str_replace($searchString, $this->journal->getSetting('emailSignature'), $this->getBody())); } $envelopeSender = $this->journal->getSetting('envelopeSender'); if (!empty($envelopeSender) && Config::getVar('email', 'allow_envelope_sender')) { $this->setEnvelopeSender($envelopeSender); } } return parent::send($clearAttachments); }
/** * Send the email. * Aside from calling the parent method, this actually attaches * the persistent attachments if they are used. * @param $clearAttachments boolean Whether to delete attachments after */ function send($clearAttachments = true) { if (isset($this->journal)) { //If {$templateSignature} and/or {$templateHeader} // exist in the body of the message, replace them with // the journal signature; otherwise just pre/append // them. This is here to accomodate MIME-encoded // messages or other cases where the signature cannot // just be appended. $header = $this->journal->getSetting('emailHeader'); if (strstr($this->getBody(), '{$templateHeader}') === false) { $this->setBody($header . "\n" . $this->getBody()); } else { $this->setBody(str_replace('{$templateHeader}', $header, $this->getBody())); } $signature = $this->journal->getSetting('emailSignature'); if (strstr($this->getBody(), '{$templateSignature}') === false) { $this->setBody($this->getBody() . "\n" . $signature); } else { $this->setBody(str_replace('{$templateSignature}', $signature, $this->getBody())); } $envelopeSender = $this->journal->getSetting('envelopeSender'); if (!empty($envelopeSender) && Config::getVar('email', 'allow_envelope_sender')) { $this->setEnvelopeSender($envelopeSender); } } return parent::send($clearAttachments); }