/** * Adds opengraph data for the user * * @since 1.0 * @access public * @param string * @return */ public function addProfile(SocialUser $user) { $config = FD::config(); // Only proceed when opengraph is enabled if (!$config->get('oauth.facebook.opengraph.enabled')) { return; } $this->properties['type'] = 'profile'; $this->properties['title'] = JText::sprintf('COM_EASYSOCIAL_OPENGRAPH_PROFILE_TITLE', ucfirst($user->getName())); $this->addImage($user->getAvatar(SOCIAL_AVATAR_MEDIUM), SOCIAL_AVATAR_MEDIUM_WIDTH, SOCIAL_AVATAR_MEDIUM_HEIGHT); $this->addUrl($user->getPermalink(true, true)); return $this; }
/** * Resends activation emails to the user. * * @since 1.0 * @access public * @param SocialUser The user object. * @param SocialTableProfile The profile type. * @return bool True if success, false otherwise. * @author Mark Lee <*****@*****.**> */ public function resendActivation(SocialUser $user) { // Get the application data. $jConfig = FD::jConfig(); $config = FD::config(); // Push arguments to template variables so users can use these arguments $params = array('site' => $jConfig->getValue('sitename'), 'username' => $user->username, 'password' => $user->password_clear, 'name' => $user->getName(), 'id' => $user->id, 'avatar' => $user->getAvatar(SOCIAL_AVATAR_LARGE), 'profileLink' => $user->getPermalink(true, true), 'email' => $user->email, 'activation' => FRoute::registration(array('external' => true, 'task' => 'activate', 'controller' => 'registration', 'token' => $user->activation)), 'token' => $user->activation, 'manageAlerts' => false); // Get the email title. $title = JText::_('COM_EASYSOCIAL_REGISTRATION_ACTIVATION_REMINDER'); // Immediately send out emails $mailer = FD::mailer(); // Get the email template. $mailTemplate = $mailer->getTemplate(); // Set recipient $mailTemplate->setRecipient($user->name, $user->email); // Set title $mailTemplate->setTitle($title); // Set the contents $mailTemplate->setTemplate('site/registration/reactivate', $params); // Set the priority. We need it to be sent out immediately since this is user registrations. $mailTemplate->setPriority(SOCIAL_MAILER_PRIORITY_IMMEDIATE); // Try to send out email now. $state = $mailer->create($mailTemplate); return $state; }