class MailUserAccessEventHandler implements UserAccessEventHandler {

    @Override
    public void onAccessCreated(User user, AccessInterval accessInterval) {
        var contextMap = getContextMap(user, accessInterval.getEndTime());
        var subjectTextPair =
                velocityMailTemplateService.getSubjectAndText("/templates/mail/UserAccessCreated.vm", contextMap);
        var message = new TimeAwareMessage(user, user, subjectTextPair.getFirst(),
                subjectTextPair.getSecond(), accessInterval.getEndTime());
        mailSenderAdapter.queueMessage(message);
    }

    public  MailUserAccessEventHandler(MailSenderAdapter mailSenderAdapter,
                                      UserService userService,
                                      VelocityMailTemplateService velocityMailTemplateService,
                                      ProjectBoardConfigurationProperties configurationProperties);

}