public async Task <Unit> Handle(SendMailAccessRequestCommand request, CancellationToken cancellationToken) { var appInfo = await _applicationInfoRepository.Get(); var rfaProfiles = request.RfaEmails; if (rfaProfiles == default || !rfaProfiles.Any()) { throw new NoRfaFoundException(); } //Send mail to the rfa account await _repository.SendMail( new Message( "AccessRequestRfa", rfaProfiles, "Nouvelle demande d'accès", appInfo.NameApp.Value, request.FirstName, request.LastName, request.Email, _emailConfig.RedirectUrlAddUser ), appInfo ); //Send mail to user account await _repository.SendMail( new Message( "AccessRequestUser", new List <string> { request.Email }, "Votre demande d'accès a été prise en compte." ), appInfo ); return(new Unit()); }
public async Task SendMailAccessRequest(SendMailAccessRequestCommand accessRequest) { await _mediator.Send(accessRequest); }