private async Task SendEmailNotificationAsync(Notification notification) { Log.Information($"Send Email Notification {notification.Id} to {notification.User.Email}: {notification.Message}"); await SendEmailService.SendNotificationEmailAsync(notification); notification.DateEmailSent = DateTime.UtcNow; await NotificationRepository.UpdateAsync(notification); }
public SendNotificationService( ITranslator translator, IJobRepository <Email> emailRepository, IJobRepository <UserRole> userRolesRepository, SendEmailService sendEmailService, IBackgroundJobClient backgroundJobClient, IJobRepository <Notification> notificationRepository ) { Translator = translator; EmailRepository = emailRepository; UserRolesRepository = userRolesRepository; SendEmailService = sendEmailService; BackgroundJobClient = backgroundJobClient; NotificationRepository = notificationRepository; }