private IUserService userService;
public NewVersionsAdditionalEmailHtmlNotificationDemoPage(PageParameters parameters) {
super(parameters);
User user = userService.getByUserName(ConsoleNotificationIndexPage.DEFAULT_USERNAME);
if (user == null) {
LOGGER.error("There is no user available");
Session.get().error(getString("console.notifications.noDataAvailable"));
throw new RestartResponseException(ConsoleNotificationIndexPage.class);
}
List<EmailAddress> emailAddresses = user.getAdditionalEmails();
if (emailAddresses == null || emailAddresses.isEmpty()) {
LOGGER.error("There is no additional email address available");
Session.get().error(getString("console.notifications.noDataAvailable"));
throw new RestartResponseException(ConsoleNotificationIndexPage.class);