Esempio n. 1
0
        public bool Execute(string data, FormSubmitContext formSubmitContext)
        {
            Assert.ArgumentNotNull(data, nameof(data));
            Assert.ArgumentNotNull(formSubmitContext, nameof(formSubmitContext));
            if (formSubmitContext.Fields.Count > 4 && formSubmitContext.Fields[4] != null && formSubmitContext.Fields[4] is FileUploadModel)
            {
                fileUpload = formSubmitContext.Fields[4] as FileUploadModel;
            }
            //Get all Data Posted from FORM
            var formDict = new FormDictionary();

            hstable = formDict.GetFieldsDictionary(formSubmitContext.Fields);
            Dictionary <string, string> attributeList = new Dictionary <string, string>();

            #region Profile Form
            if (formSubmitContext.FormId != null && formSubmitContext.FormId.Equals(new Guid("{3C63E239-4DE8-4615-8C1F-B1C35A2167D8}")))
            {
                isJobApplicationForm = true;
                EmailTemplate        = "AIE_CareersEmail";
            }
            #endregion

            #region Book a Meeting Form
            else if (formSubmitContext.FormId != null && formSubmitContext.FormId.Equals(new Guid("{12222371-463a-4679-b9e2-c15187a8116a}")))

            {
                isBookAMeeting = true;
                EmailTemplate  = "AIE_BookAMeeting";
            }
            #endregion

            #region Looking For Brochure Form
            else if (formSubmitContext.FormId != null && formSubmitContext.FormId.Equals(new Guid("{9EDEE103-DE3C-45F7-970D-FC1D13D5D7D4}")))
            {
                isLookingBrochure = true;
                EmailTemplate     = "AIE_LookingBrochure";
            }
            #endregion

            #region Contact Corporate Form
            else
            {
                EmailTemplate = "AIE_ContactEmail";
            }
            #endregion

            bool isMailSent = SendEmailNotification(hstable);

            return(isMailSent);
        }