本文整理汇总了PHP中People::Email方法的典型用法代码示例。如果您正苦于以下问题:PHP People::Email方法的具体用法?PHP People::Email怎么用?PHP People::Email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::Email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysqli_connect
require 'model/model.php';
require 'dbConnection.php';
$userID = $match[1];
$conn = mysqli_connect(SERVER_ADDRESS, USER_NAME, PASSWORD, DATABASE);
$user = People::getUser($userID, $conn);
if ($user[0] != 1) {
mysqli_close($conn);
header('Content-type: application/json');
echo json_encode(array("status" => false, "msg" => $user[1]));
die;
}
$user = $user[1];
$loginInfo = People::getUserLoginInfo($userID, $conn);
if ($loginInfo[0] != 1) {
mysqli_close($conn);
header('Content-type: application/json');
echo json_encode(array("status" => false, "msg" => "Error! Contact Registration Desk Immediately."));
die;
}
mysqli_close($conn);
$loginInfo = $loginInfo[1];
if (is_null($loginInfo['password'])) {
header('Content-type: application/json');
echo json_encode(array("status" => false, "msg" => "Account already verified."));
die;
}
People::Email($user['email'], $user['name'], $loginInfo['csrfToken'], $userID);
header('Content-type: application/json');
echo json_encode(array("status" => true, "msg" => "Verification link sent to registered email."));
die;
示例2: sendVerificationMailToAll
/**
* In case of Emergency
* Sends Verification mail to all those who have not confirmed
* Need in case,after fixing mass bug on mail system
* @param MySQLi $conn database connection object
*/
public static function sendVerificationMailToAll($conn)
{
$sql = "SELECT * FROM People NATURAL JOIN LoginTable WHERE type > 0 ";
$result = mysqli_query($conn, $sql);
if ($result) {
while ($row = mysqli_fetch_array($result, MYSQL_ASSOC)) {
$email = $row['email'];
$name = $row['name'];
$token = $row['csrfToken'];
$pid = $row['pId'];
People::Email($email, $name, $token, $pid, false);
echo "Email send to " . $email . "\n";
}
} else {
echo "Error in Query Execution";
}
}