Пример #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="GuestInviteController" /> class.
        /// </summary>
        /// <param name="userApi">The user api.</param>
        /// <param name="emailSendingService">The email sending service.</param>
        /// <param name="projectApi">The project API.</param>
        /// <param name="repositoryFactory">The repository factory.</param>
        /// <param name="validatorLocator">The validator locator.</param>
        /// <param name="eventService">The event service.</param>
        /// <param name="loggerFactory">The logger.</param>
        /// <param name="serializer">The serializer.</param>
        public GuestInviteController(
            IUserApi userApi,
            IProjectApi projectApi,
            IEmailSendingService emailSendingService,
            IRepositoryFactory repositoryFactory,
            IValidatorLocator validatorLocator,
            IEventService eventService,
            ILoggerFactory loggerFactory,
            IObjectSerializer serializer)
        {
            try
            {
                _guestInviteRepository = repositoryFactory.CreateRepository <GuestInvite>();
            }
            catch (Exception)
            {
                // supressing the repository exceptions for initial testing
            }

            _userApi             = userApi;
            _emailSendingService = emailSendingService;
            _projectApi          = projectApi;
            _validatorLocator    = validatorLocator;
            _eventService        = eventService;
            _logger     = loggerFactory.GetLogger(this);
            _serializer = serializer;
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="GuestSessionController" /> class.
        /// </summary>
        /// <param name="repositoryFactory">The repository factory.</param>
        /// <param name="validatorLocator">The validator locator.</param>
        /// <param name="eventService">The event service.</param>
        /// <param name="loggerFactory">The logger.</param>
        /// <param name="emailSendingService"></param>
        /// <param name="serviceToServiceProjectApi"></param>
        /// <param name="userApi"></param>
        /// <param name="projectLobbyStateController"></param>
        /// <param name="serviceToServiceAccountSettingsApi">The API for Account/Tenant specific settings</param>
        /// <param name="synthesisObjectSerializer">The Synthesis object serializer</param>
        /// <param name="projectGuestContextService"></param>
        /// <param name="requestHeaders"></param>
        /// <param name="maxGuestsAllowedInProject"></param>
        public GuestSessionController(
            IRepositoryFactory repositoryFactory,
            IValidatorLocator validatorLocator,
            IEventService eventService,
            ILoggerFactory loggerFactory,
            IEmailSendingService emailSendingService,
            IProjectApi serviceToServiceProjectApi,
            IUserApi userApi,
            IProjectLobbyStateController projectLobbyStateController,
            ISettingApi serviceToServiceAccountSettingsApi,
            IObjectSerializer synthesisObjectSerializer,
            IProjectGuestContextService projectGuestContextService,
            IRequestHeaders requestHeaders,
            int maxGuestsAllowedInProject)
        {
            _guestSessionRepository = repositoryFactory.CreateRepository <GuestSession>();
            _guestInviteRepository  = repositoryFactory.CreateRepository <GuestInvite>();

            _validatorLocator            = validatorLocator;
            _eventService                = eventService;
            _logger                      = loggerFactory.GetLogger(this);
            _projectLobbyStateController = projectLobbyStateController;
            _emailSendingService         = emailSendingService;

            _serviceToServiceProjectApi = serviceToServiceProjectApi;
            _userApi = userApi;
            _serviceToServiceAccountSettingsApi = serviceToServiceAccountSettingsApi;
            _synthesisObjectSerializer          = synthesisObjectSerializer;
            _projectGuestContextService         = projectGuestContextService;
            _requestHeaders            = requestHeaders;
            _maxGuestsAllowedInProject = maxGuestsAllowedInProject;
        }
 public CurrencyExchangeTicketController(IEmailSendingService emailSendingService, ICurrencyExchangeTicketsService ticketService, IUserContextService userContextService, ApplicationUserManager userManager)
 {
     _ticketService       = ticketService ?? throw new ArgumentNullException(nameof(ticketService));
     _userContextService  = userContextService ?? throw new ArgumentNullException(nameof(userContextService));
     _userManager         = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _emailSendingService = emailSendingService ?? throw new ArgumentNullException(nameof(emailSendingService));
 }
Пример #4
0
 public void TestsSetUp()
 {
     _contextMock = new Mock <IInvitesContext>();
     _fakeSet     = new FakeEntitySet <Invite>(new List <Invite>());
     _contextMock.SetupGet(c => c.Invites).Returns(_fakeSet);
     _emailService = Mock.Of <IEmailSendingService>();
     _service      = new InvitesService(_contextMock.Object, _emailService);
 }
 public AuthenticationController(
     IAuthenticationService authService,
     UserManager <ApplicationUser> userManager,
     IEmailSendingService emailService)
 {
     _authService  = authService;
     _userManager  = userManager;
     _emailService = emailService;
 }
 public static Task SendEmail(this IEmailSendingService emailSendingService,
                              string subject,
                              MarkdownString body,
                              RecepientData sender,
                              RecepientData recepient)
 =>
 emailSendingService.SendEmails(subject,
                                body,
                                sender,
                                new[] { recepient, });
 public ConfirmedUsersService(IRepositoryWrapper repoWrapper,
                              UserManager <User> userManager,
                              IEmailSendingService emailSendingService,
                              IEmailContentService emailContentService)
 {
     _repoWrapper         = repoWrapper;
     _userManager         = userManager;
     _emailSendingService = emailSendingService;
     _emailContentService = emailContentService;
 }
Пример #8
0
 public UsersController(
     AdminAppContext db,
     UserManager <ApplicationUser> userManager,
     RoleManager <ApplicationRole> roleManager,
     IEmailSendingService emailService,
     IErrorLoggingService errorLogger) : base(db)
 {
     _userManager  = userManager;
     _roleManager  = roleManager;
     _emailService = emailService;
     _errorLogger  = errorLogger;
 }
 public CityParticipantsService(IRepositoryWrapper repositoryWrapper,
                                IMapper mapper,
                                UserManager <User> userManager,
                                IAdminTypeService adminTypeService,
                                IEmailSendingService emailSendingService,
                                IEmailContentService emailContentService)
 {
     _repositoryWrapper   = repositoryWrapper;
     _mapper              = mapper;
     _userManager         = userManager;
     _adminTypeService    = adminTypeService;
     _emailSendingService = emailSendingService;
     _emailContentService = emailContentService;
 }
 public EmailReminderService(IRepositoryWrapper repoWrapper,
                             IAuthEmailService authEmailServices,
                             IEmailContentService emailContentService,
                             IEmailSendingService emailSendingService,
                             IMapper mapper,
                             UserManager <User> userManager)
 {
     _repoWrapper         = repoWrapper;
     _authEmailServices   = authEmailServices;
     _emailContentService = emailContentService;
     _emailSendingService = emailSendingService;
     _mapper      = mapper;
     _userManager = userManager;
 }
Пример #11
0
 public UsersController(IUserService userService,
                        UserManager <User> userManager,
                        IMapper mapper,
                        SignInManager <User> signInManager,
                        IEmailSendingService emailSendingService,
                        IConfiguration configuration)
 {
     _userService         = userService;
     _userManager         = userManager;
     _mapper              = mapper;
     _signInManager       = signInManager;
     _emailSendingService = emailSendingService;
     _configuration       = configuration;
 }
Пример #12
0
 public AuthService(UserManager <User> userManager,
                    SignInManager <User> signInManager,
                    IEmailSendingService emailSendingService,
                    IEmailContentService emailContentService,
                    IMapper mapper,
                    IRepositoryWrapper repoWrapper)
 {
     _userManager         = userManager;
     _signInManager       = signInManager;
     _emailSendingService = emailSendingService;
     _emailContentService = emailContentService;
     _mapper      = mapper;
     _repoWrapper = repoWrapper;
 }
 public NewPlastMemberEmailGreetingService(IRepositoryWrapper repoWrapper,
                                           UserManager <User> userManager,
                                           IEmailSendingService emailSendingService,
                                           IEmailContentService emailContentService,
                                           ICityService cityService,
                                           IUserService userService)
 {
     _repoWrapper         = repoWrapper;
     _userManager         = userManager;
     _emailSendingService = emailSendingService;
     _emailContentService = emailContentService;
     _cityService         = cityService;
     _userService         = userService;
 }
Пример #14
0
        public AuthEmailService(IEmailSendingService emailSendingService,
                                IEmailContentService emailContentService,
                                IAuthService authService,
                                UserManager <User> userManager,
                                IUrlHelperFactory urlHelperFactory,
                                IActionContextAccessor actionContextAccessor,
                                IHttpContextAccessor contextAccessor)
        {
            _emailSendingService = emailSendingService;
            _emailContentService = emailContentService;
            _authService         = authService;
            _userManager         = userManager;

            _contextAccessor       = contextAccessor;
            _urlHelperFactory      = urlHelperFactory;
            _actionContextAccessor = actionContextAccessor;
        }
        /// <summary>
        /// Use this method when no additional parameters are needed for users
        /// </summary>
        public static async Task SendEmail(this IEmailSendingService emailSendingService,
                                           EmailModelBase model,
                                           string subject,
                                           string body)
        {
            var projectEmailEnabled = model.GetEmailEnabled();

            if (!projectEmailEnabled)
            {
                return;
            }

            var recipients = model.GetRecipients();

            await emailSendingService.SendEmails(subject,
                                                 new MarkdownString(body),
                                                 model.Initiator.ToRecepientData(),
                                                 recipients.Select(r => r.ToRecepientData()).ToList());
        }
Пример #16
0
 public EmailSendingServiceTests()
 {
     _target = new EmailSendingService(_emailApiMock.Object, _appSettingsReaderMock.Object);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountsController"/> class.
 /// </summary>
 /// <param name="userManager">An instance of <see cref="ApplicationUserManager"/>.</param>
 /// <param name="emailSendingService">Email sending service.</param>
 /// <param name="invitesService">Invite service.</param>
 public AccountsController(ApplicationUserManager userManager, IEmailSendingService emailSendingService, IInvitesService invitesService)
 {
     _userManager         = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _emailSendingService = emailSendingService ?? throw new ArgumentNullException(nameof(emailSendingService));
     _invitesService      = invitesService ?? throw new ArgumentNullException(nameof(invitesService));
 }
Пример #18
0
 public EmailSender(IEmailContentCreator emailContentCreator, IEmailSendingService emailSendingService)
 {
     myEmailContentCreator = emailContentCreator ?? throw new ArgumentNullException(nameof(emailContentCreator));
     myEmailSendingService = emailSendingService ?? throw new ArgumentNullException(nameof(emailSendingService));
 }
Пример #19
0
 public EmailServiceImpl(IUriService uriService, IMailGunConfig config, IEmailSendingService messageService)
 {
     _joinRpgSender = new RecepientData(JoinRpgTeam, config.ServiceEmail);
     _uriService    = uriService;
     MessageService = messageService;
 }
 public ContactController(IEmailSendingService emailSender)
 {
     _emailSender = emailSender;
 }
 // Dependency inversion principle / Dependency injection applied
 public EmailController(IEmailService mailSrvc, IUserservice usrSvc, ILoggingService log)
 {
     this.emailService   = mailSrvc;
     this.userService    = usrSvc;
     this.loggingService = log;
 }
Пример #22
0
 public HomeService(IEmailSendingService emailSendingService)
 {
     _emailSendingService = emailSendingService;
 }
Пример #23
0
 public HelpController(IEmailSendingService emailSender)
 {
     _emailSender = emailSender;
 }
Пример #24
0
 public RegisterController(IRegisterUserService service, IEmailSendingService emailSender)
 {
     _service     = service;
     _emailSender = emailSender;
 }
Пример #25
0
 public RecordsTempController(IRecordTempService recordTempService, IEmailDataService emailDataService, IEmailSendingService emailSendingService)
 {
     _recordTempService   = recordTempService;
     _emailDataService    = emailDataService;
     _emailSendingService = emailSendingService;
 }
Пример #26
0
 public EmailTempDataController(IEmailTempDataService emailTempDataService, IEmailSendingService emailSendingService)
 {
     _emailTempDataService = emailTempDataService;
     _emailSendingService  = emailSendingService;
 }
Пример #27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InvitesService"/> class.
 /// </summary>
 /// <param name="context">An invites context.</param>
 /// <param name="emailSendingService">An email sending service.</param>
 public InvitesService(IInvitesContext context, IEmailSendingService emailSendingService)
 {
     _context             = context ?? throw new ArgumentNullException(nameof(context));
     _emailSendingService = emailSendingService ?? throw new ArgumentNullException(nameof(emailSendingService));
 }