config->get('layout'); $this->add_hook('message_headers_output', array($this, 'message_headers')); $this->add_hook('storage_init', array($this, 'storage_init')); $this->include_stylesheet('easy_unsubscribe.css'); } public function storage_init($p) { $p['fetch_headers'] = trim($p['fetch_headers'] . ' ' . strtoupper('List-Unsubscribe')); return $p; } public function message_headers($p) { $ListUnsubscribe = $p['headers']->others['list-unsubscribe']; preg_match('/<(.*?)>/', $ListUnsubscribe, $rVal); if($rVal[1]!='') $O = 'Unsubscribe'; else { preg_match('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $ListUnsubscribe, $rVal); if($rVal[0]!='') $O = 'Unsubscribe'; } $p['output']['subject']['value'] = $p['output']['subject']['value'] . $O; $p['output']['subject']['html'] = true; return $p; } }