/// <summary> /// The constructor takes GenericRepositories as argument, which is automatically created by ninject in NinjectWebCommon. /// This enables us to quickly get references to our context, by simply typing, for /// example, "IGenericRepository<Course> courseRepository", which we can use right away. /// Whenever a changes is made, use _unitOfWork.Save() to save any changes. /// </summary> /// <param name="unitOfWork"></param> /// <param name="studentRepository"></param> /// <param name="emailService"></param> /// <param name="mailHandler"></param> public StudentController(IUnitOfWork unitOfWork, IGenericRepository <Student> studentRepository, IIdentityMessageService emailService, IMailHandler mailHandler) { _studentRepository = studentRepository; _emailService = emailService; _mailHandler = mailHandler; _unitOfWork = unitOfWork; }
public static Result <MimeMessage> ProcessEmail(MimeMessage originalEmail, string from, ISettingsStore settingsStore, TelemetryClient telemetry) { var userId = originalEmail.From.Mailboxes.First().HashedEmail(); var settings = settingsStore.GetCurrentSettings(userId); var customSheets = settingsStore.GetCustomSheets(userId).ToList(); var attachments = originalEmail.LoadAttachments().ToList(); var handlers = new IMailHandler[] { new AppleHealthAttachmentMailHandler(from, settings, customSheets), new AppleHealthGoogleDriveMailHandler(from, settings, customSheets), new SettingsUpdateMailHandler(from, settingsStore), new HelpMailHandler(from), // <-- catch all }; try { return(handlers .First(h => h.CanHandle(originalEmail, attachments)) .Process(originalEmail, attachments)); } catch (Exception e) { return(Result.Failure(MailUtility.ConstructErrorMessage(originalEmail, from, e), e)); } }
/// <summary> /// Constructor /// </summary> /// <param name="channelManager">channel handler</param> /// <param name="mailQueue">mail queue</param> public RaspEmailReplyChannel(ChannelManagerBase channelManager, IMailHandler mailHandler, MailSoap12TransportBinding msg, RaspEmailBindingElement bindingElement) : base(channelManager) { _msg = msg; _mailHandler = mailHandler; _asyncTryReceiveRequest = new AsyncTryReceiveRequest(TryReceiveRequest); _bindingElement = bindingElement; }
public UserController(IUserService userService, IGlobalServices globalService, IHostingEnvironment hostingEnvironment, IMailHandler handler) { _userService = userService; _globalService = globalService; _hostingEnvironment = hostingEnvironment; _handler = handler; }
public NotificationHandler( IPetRepository petRepository, INotificationRepository notificationRepository, IMapper mapper, IUnitOfWork unitOfWork, IMailHandler mailHandler, IUserHandler userHandler, IUserRepository userRepository, IEmailHistoryRepository emailHistoryRepository, MailSettings mailSettings) { _petRepository = petRepository; _notificationRepository = notificationRepository; _mapper = mapper; _unitOfWork = unitOfWork; _petRepository = petRepository; _notificationRepository = notificationRepository; _mailHandler = mailHandler; _userHandler = userHandler; _userRepository = userRepository; _emailHistoryRepository = emailHistoryRepository; _mailSettings = mailSettings; }
public void Startup(IAgileOutlookAddIn baseAddin,IMailHandler mailHandler) { foreach (var tagger in Taggers) { tagger.Startup(baseAddin, this); } mailHandler.MailReceived += new MailEvent(Mail_Received); mailHandler.MailSent += new MailEvent(Mail_Sent); }
public SmtpListener(ISmtpConfiguration configuration, ILogger logger, IMailHandler mailHandler) { _configuration = configuration; _logger = logger; _mailHandler = mailHandler; }
/// <summary> /// Constructor /// </summary> /// <param name="mailHandler">outbox used for sending</param> /// <param name="remoteAddress">remote address to which the request channel sends messages</param> /// <param name="channelManager">channel handler</param> public RaspEmailRequestChannel(IMailHandler mailHandler, EndpointAddress remoteAddress, ChannelManagerBase channelManager) : base(channelManager) { _mailHandler = mailHandler; _remoteAddress = remoteAddress; }
/// <summary> /// Constructor /// </summary> /// <param name="msg">The incoming System.ServiceModel.Channels.Message that contains the request</param> /// <param name="mailHandler">mailhandler</param> public RaspEmailRequestContext(MailSoap12TransportBinding msg, IMailHandler mailHandler, RaspEmailBindingElement bindingElement) { _requestMessage = msg; pMailHandler = mailHandler; _bindingElement = bindingElement; }
public RouteContainer(IMailHandler handler, string routeMsg) { MailHandler = handler; RouteMessage = routeMsg; }
public ContactController(IMailHandler mailHandler, ContactDbContext context, IOptions <MailHandler> mailOptions) { _mailHandler = mailHandler; _context = context; _mailOptions = mailOptions; }
/// <summary> /// Constructor /// </summary> /// <param name="firstMessage">The first message in the queue</param> /// <param name="mailHandler">The mail handler from which the rest of the messages will be gotten</param> public RaspEmailQueue(MailSoap12TransportBinding firstMessage, RaspMailHandler mailHandler) : base(mailHandler) { _firstMessage = firstMessage; _mailHandler = mailHandler; }
public void InitializeSyncTimesAccounts(DateTime time, IMailHandler mailHandler) { SyncTimes.Clear(); //Outlook.NameSpace nameSpace = null; //Outlook.Folders profileFolders = null; var profileFolders = mailHandler.GetWatchFolders(); try { //if (mailHandler.OutlookApp == null) return; //nameSpace = OutlookApp.GetNamespace("MAPI"); //if (nameSpace != null) //{ // profileFolders = nameSpace.Folders; // int numberOfProfiles = profileFolders.Count; for (int i = 0; i < profileFolders.Count; i++) { var currProfile = profileFolders[i]; if (currProfile != null) { SyncTime NewTime = new SyncTime(); NewTime.AccountID = currProfile.EntryID; NewTime.LatestTime = time; SyncTimes.Add(NewTime); //Marshal.ReleaseComObject(currProfile); } } //} } catch (Exception ex) { throw ex; } finally { //if (nameSpace != null) //Marshal.ReleaseComObject(nameSpace); if (profileFolders != null) { profileFolders.ToList().ForEach(m => Marshal.ReleaseComObject(m)); } //Marshal.ReleaseComObject(profileFolders); } }
public SmtpClientSession(ILogger logger, IMailHandler mailHandler) { _logger = logger; _mailHandler = mailHandler; }
public EjemploEnviarEmailController(IMailHandler mailHandler) { _mailHandler = mailHandler; }