Example #1
0
        public void Submit(string subject, string supportrequest)
        {
            if (sessionInstance.LoggedIn == false)
            {
                return;
            }


            try
            {
                supportrequest = "User Id: " + sessionInstance.UserId + System.Environment.NewLine +
                                 "Email: " + sessionInstance.Username + System.Environment.NewLine + System.Environment.NewLine +
                                 supportrequest;

                // TODO: inject the support address from appsettings.json
                email.SendMail_BackgroundThread(supportrequest, subject, "*****@*****.**", false, null, Majorsilence.Vpn.Logic.Email.EmailTemplates.None);

                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.OK;
                this.HttpContext.Response.Redirect("/support/thankyou", false);
            }
            catch (Majorsilence.Vpn.Logic.Exceptions.InvalidDataException ide)
            {
                Majorsilence.Vpn.Logic.Helpers.Logging.Log(ide);
                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
            }
            catch (Exception ex)
            {
                Majorsilence.Vpn.Logic.Helpers.Logging.Log(ex);
                this.HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError;
            }
        }