public function actionOpen($client, $mail) { $hit = new MandrillMailshotHit(); $mailshot = MandrillMailshot::model()->findByPk($mail); $client = Client::model()->findByPk($client); if (!$mailshot) { throw new CHttpException('mailshot [id : ' . $mail . '] was not found'); } if (!$client) { throw new CHttpException('client [id : ' . $client . '] was not found'); } $hit->clientId = $client->cli_id; $hit->mailshotId = $mailshot->id; $hit->userAgent = Yii::app()->request->getUserAgent(); $hit->ip = Yii::app()->request->getUserHostAddress(); $hit->save(); $this->redirect(['property/view', 'id' => $mailshot->instructionId]); }