internal EmailOperations(ChemOperations co)
 {
     Users           = string.Empty;
     _dialougeTarget = 0;
     _chemOperations = co;
     FillEmailRecords();
 }
        internal string SendEmail(bool data, string text, ChemOperations chemOperations)
        {
            if (string.IsNullOrEmpty(Users))
            {
                return("Email Send-failed unknown user");
            }
            Users = Users.ToLower();
            var response = "email sent To:";

            EmailContent = TargetData(ref text, chemOperations, data);
            EmailList(Users, ref response);
            if (response == "email sent To:")
            {
                return(" Email Send- failed unknown user please try emailing a target user with an ID . \n" +
                       "1- Matt.   \n" +
                       "2- Serhiy. \n" +
                       "        Example say- Email User 1 data-  to email user matt");
            }
            return(response);
        }
        private string TargetData(ref string text, ChemOperations chemOperations, bool data)
        {
            if (data)
            {
                EmailContent = string.Empty;

                EmailContent += "Chemical is " + chemOperations.Chemical + "\n";
                if (text.Contains("mw") || text.Contains("molecular weight") || text.Contains("full"))
                {
                    EmailContent += "the Molecular Weight is " + chemOperations.MolecularWeight + "\n";
                }
                if (text.Contains("formula") || text.Contains("full"))
                {
                    EmailContent += "the Molecular Formula is " + chemOperations.ChemicalFormula + "\n";
                }
                if (text.Contains("synonym") || text.Contains("full"))
                {
                    EmailContent += "the Synonym's are " + chemOperations.Synonyms + "\n";
                }
                if (text.Contains("cid") || text.Contains("full"))
                {
                    EmailContent += "the current CID's are " + chemOperations.CiDs + "\n";
                }
                if (text.Contains("keys") || text.Contains("full"))
                {
                    EmailContent += "the current INCHI keys are " + chemOperations.InchiKeys + "\n";
                }

                text = text.Replace("mw", "");
                text = text.Replace(" molecular weight", "");
                text = text.Replace("formula", "");
                text = text.Replace("synonym", "");
                text = text.Replace(" cid", "");
                text = text.Replace("keys", "");
                text = text.Replace("full", "");
                text = text.Replace(",", "");
            }

            return(EmailContent);
        }