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

        $sRef    = $oUri->segment(4);
        $sGuid   = $oUri->segment(5);
        $sHash   = $oUri->segment(6);
        $iLinkId = (int) $oUri->segment(7) ?: null;

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

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

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

        $sUrl = $oEmailer->trackLink($sRef, $iLinkId);
        if ($sUrl === false) {
            show404();
        }

        redirect($sUrl);
    }
public function track_link()
    {
        $oUri     = Factory::service('Uri');
        $oEmailer = Factory::service('Emailer', 'nails/module-email');

        $sRef    = $oUri->segment(4);
        $sGuid   = $oUri->segment(5);
        $sHash   = $oUri->segment(6);
        $iLinkId = (int) $oUri->segment(7) ?: null;

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

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

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

        $sUrl = $oEmailer->trackLink($sRef, $iLinkId);
        if ($sUrl === false) {
            show404();
        }

        redirect($sUrl);
    }
public function track_link ( ) { $ oUri = Factory :: service ( 'Uri' ) ; $ oEmailer = Factory :: service ( 'Emailer' , 'nails/module-email' ) ; $ sRef = $ oUri -> segment ( 4 ) ; $ sGuid = $ oUri -> segment ( 5 ) ; $ sHash = $ oUri -> segment ( 6 ) ; $ iLinkId = ( int ) $ oUri -> segment ( 7 ) ? : null ; // -------------------------------------------------------------------------- if ( ! $ sRef || ! $ oEmailer -> validateHash ( $ sRef , $ sGuid , $ sHash ) ) { show404 ( ) ; } // -------------------------------------------------------------------------- $ sUrl = $ oEmailer -> trackLink ( $ sRef , $ iLinkId ) ; if ( $ sUrl === false ) { show404 ( ) ; } redirect ( $ sUrl ) ; }
Track a link click and forward through
Track a link click and forward through