- Fixes click tracking that would end request when calling open tracking
This commit is contained in:
@ -32,6 +32,7 @@ class Clicks {
|
||||
if(!$statistics) {
|
||||
// track open action in case it did not register
|
||||
$opens = new Opens($url);
|
||||
$opens->display_image = false;
|
||||
$opens->track();
|
||||
$statistics = StatisticsClicks::create();
|
||||
$statistics->newsletter_id = $newsletter_id;
|
||||
|
@ -8,6 +8,7 @@ if(!defined('ABSPATH')) exit;
|
||||
|
||||
class Opens {
|
||||
public $data;
|
||||
public $display_image = true;
|
||||
|
||||
function __construct($data) {
|
||||
$this->data = $data;
|
||||
@ -30,10 +31,12 @@ class Opens {
|
||||
$statistics->queue_id = $queue_id;
|
||||
$statistics->save();
|
||||
}
|
||||
header('Content-Type: image/gif');
|
||||
// return 1x1 pixel transparent gif image
|
||||
echo "\x47\x49\x46\x38\x37\x61\x1\x0\x1\x0\x80\x0\x0\xfc\x6a\x6c\x0\x0\x0\x2c\x0\x0\x0\x0\x1\x0\x1\x0\x0\x2\x2\x44\x1\x0\x3b";
|
||||
exit;
|
||||
if ($this->display_image) {
|
||||
// return 1x1 pixel transparent gif image
|
||||
header('Content-Type: image/gif');
|
||||
echo "\x47\x49\x46\x38\x37\x61\x1\x0\x1\x0\x80\x0\x0\xfc\x6a\x6c\x0\x0\x0\x2c\x0\x0\x0\x0\x1\x0\x1\x0\x0\x2\x2\x44\x1\x0\x3b";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
private function abort() {
|
||||
|
Reference in New Issue
Block a user