email/controllers/Tracker.php
public function track_open()
    {
        $oUri     = Factory::service('Uri');
        $oEmailer = Factory::service('Emailer', 'nails/module-email');

        $sRef  = $oUri->segment(3);
        $sGuid = $oUri->segment(4);
        $sHash = $oUri->segment(5);

        // --------------------------------------------------------------------------

        if (!$sRef || !$oEmailer->validateHash($sRef, $sGuid, $sHash)) {
            show404();
        }

        // --------------------------------------------------------------------------

        //  Fetch the email
        $oEmailer->trackOpen($sRef);

        // --------------------------------------------------------------------------

        /**
         * Render out a tiny, tiny image
         * Thanks http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
         */

        header('Content-Type: image/gif');
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
        header('Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT');
        header('Cache-Control: no-store, no-cache, must-revalidate');
        header('Cache-Control: post-check=0, pre-check=0', false);
        header('Pragma: no-cache');

        echo base64_decode('R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');

        // --------------------------------------------------------------------------

        /**
         * Kill script, th, th, that's all folks. Stop the output class from hijacking
         * our headers and setting an incorrect Content-Type
         */

        exit(0);
    }
public function track_open()
    {
        $oUri     = Factory::service('Uri');
        $oEmailer = Factory::service('Emailer', 'nails/module-email');

        $sRef  = $oUri->segment(3);
        $sGuid = $oUri->segment(4);
        $sHash = $oUri->segment(5);

        // --------------------------------------------------------------------------

        if (!$sRef || !$oEmailer->validateHash($sRef, $sGuid, $sHash)) {
            show404();
        }

        // --------------------------------------------------------------------------

        //  Fetch the email
        $oEmailer->trackOpen($sRef);

        // --------------------------------------------------------------------------

        /**
         * Render out a tiny, tiny image
         * Thanks http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
         */

        header('Content-Type: image/gif');
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
        header('Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT');
        header('Cache-Control: no-store, no-cache, must-revalidate');
        header('Cache-Control: post-check=0, pre-check=0', false);
        header('Pragma: no-cache');

        echo base64_decode('R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');

        // --------------------------------------------------------------------------

        /**
         * Kill script, th, th, that's all folks. Stop the output class from hijacking
         * our headers and setting an incorrect Content-Type
         */

        exit(0);
    }
public function track_open ( ) { $ oUri = Factory :: service ( 'Uri' ) ; $ oEmailer = Factory :: service ( 'Emailer' , 'nails/module-email' ) ; $ sRef = $ oUri -> segment ( 3 ) ; $ sGuid = $ oUri -> segment ( 4 ) ; $ sHash = $ oUri -> segment ( 5 ) ; // -------------------------------------------------------------------------- if ( ! $ sRef || ! $ oEmailer -> validateHash ( $ sRef , $ sGuid , $ sHash ) ) { show404 ( ) ; } // -------------------------------------------------------------------------- //  Fetch the email $ oEmailer -> trackOpen ( $ sRef ) ; // -------------------------------------------------------------------------- /**
         * Render out a tiny, tiny image
         * Thanks http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
         */ header ( 'Content-Type: image/gif' ) ; header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ) ; header ( 'Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT' ) ; header ( 'Cache-Control: no-store, no-cache, must-revalidate' ) ; header ( 'Cache-Control: post-check=0, pre-check=0' , false ) ; header ( 'Pragma: no-cache' ) ; echo base64_decode ( 'R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' ) ; // -------------------------------------------------------------------------- /**
         * Kill script, th, th, that's all folks. Stop the output class from hijacking
         * our headers and setting an incorrect Content-Type
         */ exit ( 0 ) ; }
Track an email open.
Track an email open .