public function getUnsubscribeLink($docId) { $user = JFactory::getUser(); $link = ''; if (!$user->get('guest')) { $secret = JFactory::getConfig()->get('secret'); $type = 'document'; $code = md5($user->id . $user->email . $type . $secret); $subscriptionObject = JUDownloadFrontHelper::getSubscriptionObjectByType($user->id, $docId, $type); $link = JRoute::_('index.php?option=com_judownload&task=subscribe.remove&sub_id=' . $subscriptionObject->id . '&code=' . $code); } return $link; }