本文整理匯總了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;
}