static void Main(string[] args)
        {
            Console.WriteLine(@"
This a very simple demo of how the NonHttpRunTimeRazorSupport library 
might be used to send emails outside of the context of a running
web application.

This app is configured to drop .eml files in the C:\temp folder (see 
app.config). These files can be viewed in an email client, or on a
web site like http://www.encryptomatic.com/viewer/Default.aspx");
            var settings = new NotificationSettings(new Uri("http://www.facepack.com/"));
            var service  = new EmailNotificationService(settings);

            do
            {
                var from  = new MailAddress("*****@*****.**");
                var to    = new MailAddress("*****@*****.**");
                var model = new WelcomeModel
                {
                    Name = "Dave"
                };
                service.Send(from, to, model);
                Console.WriteLine("Message sent. Press a key to resend, or q to exit");
            } while (Console.ReadKey().KeyChar != 'q');
        }
Example #2
0
        public IActionResult Create(Review review, string hotelID)
        {
            review.HotelID = hotelID;

            if (review.Stars == 1)
            {
                _smsNotificationService.Send(review);
            }

            if (review.Stars == 5)
            {
                _emailNotificationService.Send(review);
            }

            _dao.Create(review, hotelID);
            return(Created("reviews/hotel/" + hotelID, review));
        }
        static void Main(string[] args)
        {
            Console.WriteLine(@"
This a very simple demo of how the NonHttpRunTimeRazorSupport library 
might be used to send emails outside of the context of a running
web application.

This app is configured to drop .eml files in the C:\temp folder (see 
app.config). These files can be viewed in an email client, or on a
web site like http://www.encryptomatic.com/viewer/Default.aspx");
            var settings = new NotificationSettings(new Uri("http://www.facepack.com/"));
            var service = new EmailNotificationService(settings);
            do
            {
                var from = new MailAddress("*****@*****.**");
                var to = new MailAddress("*****@*****.**");
                var model = new WelcomeModel
                {
                    Name = "Dave"
                };
                service.Send(from, to, model);
                Console.WriteLine("Message sent. Press a key to resend, or q to exit");
            } while (Console.ReadKey().KeyChar != 'q');
        }