src/Service/Emailer.php
public function trackOpen($ref)
    {
        $oEmail = $this->getByRef($ref);
        if ($oEmail) {

            //  Update the read count and a add a track data point
            $oDb = Factory::service('Database');
            $oDb->set('read_count', 'read_count+1', false);
            $oDb->where('id', $oEmail->id);
            $oDb->update($this->sTable);

            $oDb->set('created', 'NOW()', false);
            $oDb->set('email_id', $oEmail->id);

            if (activeUser('id')) {
                $oDb->set('user_id', activeUser('id'));
            }

            $oDb->insert(NAILS_DB_PREFIX . 'email_archive_track_open');
        }
    }
public function trackOpen($ref)
    {
        $oEmail = $this->getByRef($ref);
        if ($oEmail) {

            //  Update the read count and a add a track data point
            $oDb = Factory::service('Database');
            $oDb->set('read_count', 'read_count+1', false);
            $oDb->where('id', $oEmail->id);
            $oDb->update($this->sTable);

            $oDb->set('created', 'NOW()', false);
            $oDb->set('email_id', $oEmail->id);

            if (activeUser('id')) {
                $oDb->set('user_id', activeUser('id'));
            }

            $oDb->insert(NAILS_DB_PREFIX . 'email_archive_track_open');
        }
    }
public function trackOpen ( $ ref ) { $ oEmail = $ this -> getByRef ( $ ref ) ; if ( $ oEmail ) { //  Update the read count and a add a track data point $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> set ( 'read_count' , 'read_count+1' , false ) ; $ oDb -> where ( 'id' , $ oEmail -> id ) ; $ oDb -> update ( $ this -> sTable ) ; $ oDb -> set ( 'created' , 'NOW()' , false ) ; $ oDb -> set ( 'email_id' , $ oEmail -> id ) ; if ( activeUser ( 'id' ) ) { $ oDb -> set ( 'user_id' , activeUser ( 'id' ) ) ; } $ oDb -> insert ( NAILS_DB_PREFIX . 'email_archive_track_open' ) ; } }
Increments an email's open count and adds a tracking note

@param  string $ref The email's reference

@return void
Increments an email s open count and adds a tracking note