コード例 #1
0
        public IMailNotifier Build()
        {
            var notifier = new MailNotifier(
                _fromAddress,
                _outgoingQueue,
                _mailingListBroker,
                _templateEngine,
                _emailSenders);

            return notifier;
        }
コード例 #2
0
        public void Setup()
        {
            _sender = new TestEmailSender();
            var outgouingQueue = new TransientQueue();
            var mailingListBroker = new TestMailingListBroker().Register<string>("[email protected]", "[email protected]");
            var templateEngine = new MailTemplateEngine();
            templateEngine.Register<string>(m => new MailView(string.Format("Subject for {0}", m),
                                                               string.Format("Body for {0}!", m)));

            _notifier = new MailNotifier("[email protected]", outgouingQueue, mailingListBroker, templateEngine, _sender);
        }
コード例 #3
0
        public void Setup()
        {
            _sender = new TestEmailSender();
            var outgouingQueue = new PersistentQueue(Guid.NewGuid().ToString("n"));
            var mailingListBroker = new MailingListBroker(new[]
            {
                new MailingRule("*", new MailingList("[email protected]"))
            });
            var templateEngine = new RazorMailTemplateEngine(new RazorTemplatesFactory("Resources"), true);

            _notifier = new MailNotifier(
                "[email protected]",
                outgouingQueue,
                mailingListBroker,
                templateEngine,
                _sender);
        }