public function cronSendWellcomeLetter() { $preferenceValues = array('send_wellcome_letter' => 1); $userIdList = $this->userDao->findUserIdListByPreferenceValues($preferenceValues); if (empty($userIdList)) { return; } $users = $this->findUserListByIdList($userIdList); foreach ($users as $user) { $this->sendWellcomeLetter($user); } }