public void Handle(SendNotificationCommand command) { string email = _emailRepository.GetEmail(command.LoginName); _smtpClient.Send(email, command.Title, command.Body); _notificationRepository.Add(email, command.Title, command.Body, _dateTimeProvider.Now(), command.LoginName, command.NotificationType); _eventBus.Publish(new NotificationSentEvent() { LoginName = command.LoginName, Email = email, NotificationType = command.NotificationType }); }
public GetEmailResponse Handle(string loginName) { return(new GetEmailResponse(_repository.GetEmail(loginName))); }