private function onRequestMail(GWF_Group $group, GWF_User $user, GWF_UsergroupsInvite $request) { if (false === ($leader = $group->getFounder())) { return false; } if ('' === ($email = $leader->getValidMail())) { return false; } $userid = $user->getID(); $groupid = $group->getID(); $token = $request->getHashcode(); $link = Common::getAbsoluteURL('index.php?mo=Usergroups&me=Accept&uid=' . $userid . '&gid=' . $groupid . '&token=' . $token); $link = GWF_HTML::anchor($link, $link); $mail = new GWF_Mail(); $mail->setSender(GWF_BOT_EMAIL); $mail->setReceiver($email); $mail->setSubject($this->module->lang('mail_subj_req', array($user->displayUsername(), $group->display('group_name')))); $mail->setBody($this->module->lang('mail_body_req', array($leader->displayUsername(), $user->displayUsername(), $group->display('group_name'), $link))); return $mail->sendToUser($leader); }
private function getPMMessage(GWF_User $user, GWF_Group $group, $bbcode = true) { # bbcode urls, no web root needed $href_join = '/index.php?mo=Usergroups&me=Join&gid=' . $group->getVar('group_id'); $href_deny = '/index.php?mo=Usergroups&me=Join&deny=' . $group->getVar('group_id'); $founder = $group->getFounder(); if ($bbcode === true) { $link_yes = sprintf('[url=%s]%s[/url]', $href_join, $href_join); $link_no = sprintf('[url=%s]%s[/url]', $href_deny, $href_deny); } else { $link_yes = GWF_HTML::anchor($href_join, $href_join); $link_no = GWF_HTML::anchor($href_deny, $href_deny); } return $this->module->langUser($user, 'invite_message', array($user->getVar('user_name'), $founder->getVar('user_name'), $group->getName(), $link_yes, $link_no)); }