예제 #1
0
        public async Task <IActionResult> ContactUs(string contactName, string emailAddress)
        {
            // Send thank you email to contact
            var thankYouEmail = new SendEmailCommand()
            {
                To      = emailAddress,
                Subject = "Thank you for reaching about",
                Body    = "We will contact you shortly",
            };

            await _queueCommunicator.SendAsync(thankYouEmail);

            // Send new contact email to admin
            var adminEmail = new SendEmailCommand
            {
                To      = "*****@*****.**",
                Subject = "We have a new contact",
                Body    = $"{contactName} has reached out view the contact form. Please repond back at {emailAddress}"
            };

            await _queueCommunicator.SendAsync(adminEmail);


            ViewBag.Message = "Thank you we can received your message ^__^";

            return(View());
        }
        public async Task <IActionResult> ContactUs(string contactName, string emailAddress)
        {
            // send Thankyou email to contact
            var thankYouEmail = new SendEmailCommand()
            {
                To      = emailAddress,
                Subject = "Thank you for reaching out",
                Body    = "we will contact you shortly"
            };

            await _queueCommunicator.SendAsync(thankYouEmail);

            // send new contact email to admin
            var adminEmailCommand = new SendEmailCommand()
            {
                To      = "*****@*****.**",
                Subject = "New Contact",
                Body    = $"{contactName} has reached out via contact form. Please respond back at {emailAddress}"
            };

            await _queueCommunicator.SendAsync(adminEmailCommand);

            ViewBag.Message = "Thank you we've recived your message =)";
            return(View());
        }
예제 #3
0
        public async Task <IActionResult> Index()
        {
            var thk = new SendEmailCommand
            {
                To      = "r_lorcapiote",
                Body    = "teste",
                Subject = "ddd"
            };

            await communicator.SendAsync(thk);

            ViewBag.Message = "Valeu";
            return(View());
        }
예제 #4
0
        public async Task <IActionResult> Index(string uploadlinks)
        {
            var splitLinks = uploadlinks.Split(',');

            foreach (string item in splitLinks)
            {
                await _queueCommunicator.SendAsync(item);
            }


            return(View());
        }
예제 #5
0
        public async Task <IActionResult> ContactUs(string contactName, string emailAddress)
        {
            var thankYouEmail = new SendEmailCommand
            {
                To      = emailAddress,
                Subject = "Some subject",
                Body    = "We will contact you shortly"
            };
            await _communicator.SendAsync(thankYouEmail);

            var adminEmail = new SendEmailCommand
            {
                To      = "*****@*****.**",
                Subject = "Some subject",
                Body    = $"{contactName}  has react out to you..."
            };
            await _communicator.SendAsync(adminEmail);

            ViewBag.Message = "Thank you for your message";
            return(View());
        }
        public async Task <IActionResult> ContactUS(string contactName, string emailAddress)
        {
            // Send Thank you e-mail to Contact
            var thankYouEmail = new SendEmailCommand()
            {
                To      = emailAddress,
                Subject = "Thank you for reaching out!",
                Body    = "We'll contact you shortly."
            };
            await _queueCommunicator.SendAsync(thankYouEmail);

            // Send New Contact e-mail to Admin
            var adminEmail = new SendEmailCommand()
            {
                To      = "*****@*****.**",
                Subject = "New contact!",
                Body    = $"{contactName} has reached out via contact form. Please respond back at {emailAddress}."
            };
            await _queueCommunicator.SendAsync(adminEmail);

            ViewBag.Message = "Thank you we've received your message =)";
            return(View());
        }
예제 #7
0
        public async Task <IActionResult> Send()
        {
            await _queueCommunicator.SendAsync
            (
                new SendEmailCommand()
            {
                To      = "*****@*****.**",
                Subject = "Testing Email",
                Body    = "Best Body Around"
            }
            );

            return(Ok("Sent"));
        }
예제 #8
0
        public async Task <IActionResult> ContactUs(string contactName, string emailAddress)
        {
            var thankYou = new SendEmailComand()
            {
                To      = emailAddress,
                Subject = "Thank you",
                Body    = "We will contact with you"
            };

            await _queueCommunicator.SendAsync(thankYou);

            var adminEmail = new SendEmailComand()
            {
                To      = "[email protected] ",
                Subject = "New Contact",
                Body    = $"{contactName} {emailAddress}"
            };

            await _queueCommunicator.SendAsync(adminEmail);

            ViewBag.Message = "Thank you for message";
            return(View());
        }
예제 #9
0
        public async Task QueuePendingNotifications()
        {
            var response = await _httpClient.GetAsync(_notificationsApiSettings.Path);

            response.EnsureSuccessStatusCode();
            var content = await response.Content.ReadAsStringAsync();

            var notifications = JsonConvert.DeserializeObject <IEnumerable <PendingNotification> >(content);

            var commands = notifications
                           .Select(x => new SendEmailCommand(x.Id,
                                                             x.To,
                                                             x.Subject,
                                                             x.Body));

            foreach (var command in commands)
            {
                await _queueCommunicator.SendAsync(command);
            }
        }