/** * Send confirmation reminder emails for users that signed up on current wiki 7 days ago */ function sendReminder() { global $wgCityId, $wgServer; wfProfileIn(__METHOD__); // update url $wgServer = WikiFactory::getVarValueByName('wgServer', $wgCityId); $users = getRecipientsForCurrentWiki(); $cnt = 0; $userLoginHelper = new UserLoginHelper(); foreach ($users as $user) { // send reminder email $result = $userLoginHelper->sendConfirmationReminderEmail($user); if (!$result->isGood()) { echo "Error: Cannot send reminder to user (id=" . $user->getId() . ", email=" . $user->getEmail() . "): " . $result->getMessage() . "\n"; } else { $cnt++; echo "Sent reminder to user (id=" . $user->getId() . ", email=" . $user->getEmail() . ").\n"; } } echo "WikiId {$wgCityId}: " . sizeof($users) . " of total {$cnt} confirmation reminder emails sent.\n"; wfProfileOut(__METHOD__); }