Exemple #1
0
        public void SendAppointmentDetails(ClientMotherModel motherRequest, ScanCenterProfileModel profile, string referid,
                                           string baseUrl = "", bool includeLink = false, bool isMotherAppointment = true)
        {
            string link = string.Empty;

            //string googleCalC2M = string.Empty;
            if (!string.IsNullOrEmpty(referid))
            {
                referid = HttpUtility.UrlEncode(referid);
            }
            if (!motherRequest.IsCompleted)
            {
                link = $@"<a href='{baseUrl}/mother/{profile.UniqueName}?refer={referid}'>Registration Link</a>";
            }


            this.To      = motherRequest.Email;
            this.ReplyTo = new MailAddress(profile.Email, profile.Name);
            this.Subject = "Appointment - Verify and Confirm";
            this.Body    = $@"Hi {motherRequest.FirstName},
                                        <br>
                                        Thank you for scheduling your Ultrasound appointment with us. Prior to your appointment, please complete your registration by clicking the link below. We look forward to seeing you and your baby soon.<br><br>
                                         {link}<br><br>
                                        Thank you and have a great day!<br>
                                        {profile.Name}
                                        ";
            this.Send();
        }
        public async Task <IActionResult> SignUpPost([FromForm] ScanCenterProfileModel signUpRequest)
        {
            ViewBag.IsSuccess = false;
            string pass = signUpRequest.Password;

            if (await _scanCenterProfileQuery.GetByEmail(signUpRequest.Email) != null)
            {
                ViewBag.ErrorMessage = "Email already exists!";
                return(View("Index", signUpRequest));
            }
            if (await _scanCenterProfileQuery.GetByUniqueName(signUpRequest.UniqueName) != null)
            {
                ViewBag.ErrorMessage = "Company already exists!";
                return(View("Index", signUpRequest));
            }
            signUpRequest.Password = await _cryptography.Encrypt(signUpRequest.Password, _appSettings);

            int primaryKey = await _scanCenterProfileQuery.CreateProfile(signUpRequest);

            string login     = $"{Request.Scheme}://{Request.Host}/scancenter/signup/login";
            string emaillink = $"{Request.Scheme}://{Request.Host}/Mother/{signUpRequest.UniqueName}";

            _emailManager.SMTPSettings = _appSettings.SMTPSettings;
            _emailManager.To           = signUpRequest.Email;
            _emailManager.Subject      = "Welcome to MyUltraSoundAppt.com";
            _emailManager.Body         = @$ "Hi {signUpRequest.Name},<br>
                                        You have successfully created an account with MyUltraSoundAppt.com<br><br>
                                        Your login email: {signUpRequest.Email}<br>
Exemple #3
0
        public void SendNotification(ClientMotherModel motherRequest, ScanCenterProfileModel profile, string baseUrl)
        {
            string emailSubject = "A new customer signed";

            if (motherRequest.IsInsuranceRequired)
            {
                emailSubject = "A new customer signed - Mommy Care Kit";
            }
            this.To      = this.SMTPSettings.DefaultTo;
            this.Subject = emailSubject;
            string mck = (!motherRequest.IsInsuranceRequired) ? "No" : "Yes";
            string bp  = (motherRequest.IsBreastPumpNeeded ? "Yes" : "No");

            this.Body = @$ "Hi,<br>
                                        A new customer signed. Please check your dashboard for details.<br>
                                        Client Name: {motherRequest.FirstName} {motherRequest.LastName}<br>
Exemple #4
0
        public async Task <bool> SignIn(HttpContext context, string email, ScanCenterProfileModel user)
        {
            var claims = new List <Claim>
            {
                new Claim(ClaimTypes.Name, user.UniqueName),
                new Claim(ClaimTypes.Email, user.Email),
                new Claim(ClaimTypes.Role, "ScanCenter"),
            };
            var claimsIdentity = new ClaimsIdentity(
                claims, CookieAuthenticationDefaults.AuthenticationScheme);

            var authProperties = new AuthenticationProperties
            {
                AllowRefresh = true,
                // Refreshing the authentication session should be allowed.

                ExpiresUtc = DateTimeOffset.UtcNow.AddDays(2),
                // The time at which the authentication ticket expires. A
                // value set here overrides the ExpireTimeSpan option of
                // CookieAuthenticationOptions set with AddCookie.

                IsPersistent = false,
                // Whether the authentication session is persisted across
                // multiple requests. When used with cookies, controls
                // whether the cookie's lifetime is absolute (matching the
                // lifetime of the authentication ticket) or session-based.

                IssuedUtc = DateTime.UtcNow
                            // The time at which the authentication ticket was issued.

                            //RedirectUri = <string>
                            // The full path or absolute URI to be used as an http
                            // redirect response value.
            };

            await context.SignInAsync(
                CookieAuthenticationDefaults.AuthenticationScheme,
                new ClaimsPrincipal(claimsIdentity),
                authProperties);

            return(true);
        }