Esempio n. 1
0
        private void SendMailToJobSeeker(UserViewModel e, string to, string name, int userId)
        {
            string jsProfile =
                $"{URLprotocol}://" +
                $"{_httpContextAccessor.HttpContext.Request.Host.Value}" +
                $"/JobSeekerManagement/Profile";

            var eModel = new EmailViewModel
            {
                Subject = "Applied Job from Placement Portal",
                Body    = "Dear " + name + ",<br/><br/> We have successfully forwarded your application for the position of " + e.JobTitlebyEmployer
                          + "<br/><br/>Corporate Name  : " + e.CompanyName + "<br/>JobRole  : " + e.JobTitleName + "<br/>Job Description  : " + e.Jobdetails
                          + "<br/><br/>In case you don't find the above details appropriate, <a href=" + jsProfile + ">update profile</a> and apply again."
                          + "<br/><br/>Recruiters will be contacting you on this mobile number +91" + e.MobileNo + "<br/>To update it, please <a href=" + jsProfile + ">click here</a>" + "<br><br>Thank You<br>Placement Portal Team",
                To       = new string[] { to },
                From     = e.Email,
                IsHtml   = true,
                MailType = (int)MailType.JobApplication
            };

            emailHandler.SendMail(eModel, userId);
        }
Esempio n. 2
0
        public ActionResult ForgotPassword(string email)
        {
            var user = HttpContext.Session.Get <UserViewModel>(Constants.SessionKeyUserInfo);//for loggging

            try
            {
                var emailID = authHandler.ForgetPassword(email);
                /* Mail Send */
                string emailEncr = EncryptDecrypt.Encrypt(emailID, "sblw-3hn8-sqoy19");
                var    basePath  = string.Format("{0}://{1}", Request.Scheme /*URLprotocol*/, Request.Host);
                var    link      = basePath + "/Auth/ResetPassword/?id=" + emailEncr;

                var eModel = new EmailViewModel
                {
                    Subject = "Reset Password",
                    Body    = "Dear Sir/Madam,<br/>You initiated a request to help with your account password. Click the link below to set a new password for CareerIndeed portal" +
                              "<br/><a href=" + link + ">Reset Password link</a><br><br>" + "Thank You<br>CareerIndeed Team",
                    To       = new string[] { emailID },
                    From     = config["EmailCredential:Fromemail"],
                    IsHtml   = true,
                    MailType = (int)MailType.ForgotPassword
                };
                emailHandler.SendMail(eModel, -1);

                //SendVerificationLinkEmail(emailID, "ResetPassword");
                ViewData["SuccessMessage"] = "Password Reset link send to your Email";
            }
            catch (UserNotFoundException ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, 0, typeof(AuthController), ex);
                ModelState.AddModelError("ErrorMessage", string.Format("{0}", ex.Message));
                ViewData["SuccessMessage"] = ex.Message;
            }
            catch (DataNotFound ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, 0, typeof(AuthController), ex);
                ModelState.AddModelError("ErrorMessage", string.Format("{0}", ex.Message));
                ViewData["SuccessMessage"] = ex.Message;
            }
            catch (Exception ex)
            {
                Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, 0, typeof(AuthController), ex);
                ModelState.AddModelError("ErrorMessage", string.Format("{0}", ex.Message));
                ViewData["SuccessMessage"] = "Error Occured,Please contact at [email protected]";
            }
            return(View());
        }
Esempio n. 3
0
        public bool ReplyToJobSeeker(MessageViewModel msg, int userId)
        {
            var tos = msg.ReceiverEmail.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

            foreach (string to in tos)
            {
                if (dashboardRepository.UpdateJobSeekerMailStatus(msg.MessageId, userId))
                {
                    var mModel = new EmailViewModel
                    {
                        From     = msg.SenderEmail,
                        To       = new string[] { to },
                        Body     = msg.Body,
                        MailType = (int)MailType.JobApplicationResponse,
                        Subject  = msg.Subject,
                        IsHtml   = true,
                    };
                    emailHandler.SendMail(mModel, userId);
                }
            }
            return(true);
        }
Esempio n. 4
0
        private void SendMail(object value, string columnName, string Email, string Name)
        {
            try
            {
                var data   = Convert.ToString(value);
                var eModel = new EmailViewModel
                {
                    Subject = "BulkJobPost",
                    Body    = "Dear Admin," + "<br/><br/>" +
                              "An Employer " + Name + "(" + Email + ") was trying to add " + data + " as " +
                              columnName + ", which does not belong to our database.please do the needful.<br><br> Thank You <br>CareerIndeed Team",
                    To       = new string[] { config["AdminMail:Email"] },
                    From     = config["EmailCredential:Fromemail"],
                    IsHtml   = true,
                    MailType = (int)MailType.ForgotPassword
                };

                emailHandler.SendMail(eModel, -1);
            }
            catch (Exception ex)
            {
            }
        }
        private void SendActivationMail(UserModel user)
        {
            string activationLink =
                $"{URLprotocol}://" +
                $"{_httpContextAccessor.HttpContext.Request.Host.Value}" +
                $"/Auth/EmailVerification?uId={user.UserId}&akey={user.ActivationKey}";

            var eModel = new EmailViewModel
            {
                Subject = "Account Activation Link",
                Body    = $"Dear {user.FirstName},<br/>Congrat's you have successfully registered with us." +
                          $"You are one step away to explore our application," +
                          $"Please <a href={activationLink}>click here</a> to activate your account." +
                          $"Your login details are below:<br/><br/>User Name:  {user.Email}<br/>Password: {user.Password} " +
                          $"<br/><br/>Thank You <br/> CareerIndeed Team",

                To       = new string[] { user.Email },
                From     = config["EmailCredential:Fromemail"],
                IsHtml   = true,
                MailType = (int)MailType.UserRegistrationActivationLink
            };

            emailHandler.SendMail(eModel, -1);
        }