contents
template
html_locale => 'en' == always use the 'english translated verison'
+ cache_images => true -- defaults to caching images - set to false to disable.
replaceImages => true|false,
locale => 'en' .... or zh_hk....
rcpts => array() // override recipients..
var $mail_method = 'SMTP';
+ var $cache_images = true;
+
function Pman_Core_Mailer($args) {
foreach($args as $k=>$v) {
// a bit trusting..
$this->$k = $v;
}
+ // allow core mailer debug setting.
+ $ff = HTML_FlexyFramework::get();
+
+ if (!empty($ff->Core_Mailer['debug'])) {
+ $this->debug = $ff->Core_Mailer['debug'];
+ }
+
+
}
/**
}
- print_R($this->images);exit;
return $dom->saveHTML();
function fetchImage($url)
{
- print_R($url);
- echo "\n";
if($this->debug) {
echo "FETCH : $url\n";
}
// unix only...
$uinfo = posix_getpwuid( posix_getuid () );
$user = $uinfo['name'];
- print_R('run');
- echo "\n";
+
$cache = ini_get('session.save_path')."/Pman_Core_Mailer-{$user}/" . md5($url);
- if (file_exists($cache) and filemtime($cache) > strtotime('NOW - 1 WEEK')) {
+ if ($this->cache_images &&
+ file_exists($cache) &&
+ filemtime($cache) > strtotime('NOW - 1 WEEK')
+ ) {
$ret = json_decode(file_get_contents($cache), true);
$ret['file'] = $cache . '.data';
return $ret;