Example #1
0
function notifyUsers($time = 604800)
{
    $database = new Database();
    foreach ($database->getAllUsers() as $user) {
        $matches = $database->getUnbetMatches($user->getId(), $time);
        $message = '<p>Dear ' . $user->getUserName() . ', you haven\'t yet placed any bets for the following upcoming events. Don\'t forget to take your chance!</p>' . matchesToString($matches) . '<p>Greetings, the ZeeJong team.</p>';
        sendMail('ZeeJong - Upcoming Events', $user->getMail(), '*****@*****.**', $message);
    }
}