* and delegate the sending operation to mailService.
*/
private void handleWeeklyDigestPageForLogin(String login) {
log.info("Preparing weekly digest for user " + login);
User user = userRepository.findUserByLogin(login);
// we want statuses for the past week
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -7);
Date lastWeek = cal.getTime();
List<StatusDTO> digestStatuses = new ArrayList<StatusDTO>(MAX_STATUS_WEEKLY_DIGEST);
int nbStatusTotal = getStatusesForDigest(user, lastWeek, MAX_STATUS_WEEKLY_DIGEST, digestStatuses);
Collection<User> suggestedUsers = suggestionService.suggestUsers(user.getLogin());
Collection<Group> suggestedGroups = suggestionService.suggestGroups(user.getLogin());
mailService.sendWeeklyDigestEmail(user, digestStatuses, nbStatusTotal,
suggestedUsers, suggestedGroups);
}