本文整理汇总了PHP中Invitation::linkByEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Invitation::linkByEmail方法的具体用法?PHP Invitation::linkByEmail怎么用?PHP Invitation::linkByEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Invitation
的用法示例。
在下文中一共展示了Invitation::linkByEmail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Event
}
if ($biography != '') {
$user->setBiography($biography);
}
$user->save();
// save the user
$user->setLastLogin($user->getDateCreated());
$user->save();
// save last login as date created
// log the event
$logEvent = new Event(array('event_type_id' => 'create_user', 'user_1_id' => $user->getId()));
$logEvent->save();
// email confirmation
$body = '<p>You have successfully registered for <a href="' . Url::base() . '">' . PIPELINE_NAME . '</a>.</p>';
$body .= '<p>Your username is ' . formatUserLink($user->getID()) . '. Have fun!</p>';
$newEmail = array('to' => $email, 'subject' => '[' . PIPELINE_NAME . '] Welcome to ' . PIPELINE_NAME . '!', 'message' => $body);
Email::send($newEmail);
// log us into the new account
Session::signIn($user->getId());
// link any email invites to this user
Invitation::linkByEmail($email, $user->getID());
// set confirm message and send us away
Session::setMessage("Registration successful! Welcome aboard.");
$json = array('success' => '1', 'successUrl' => Url::dashboard());
echo json_encode($json);
break;
default:
$json = array('error' => 'An error occurred. Please try again.');
exit(json_encode($json));
break;
}