Ejemplo n.º 1
0
        /// <summary>
        /// Get Email Template based on ID
        /// </summary>
        /// <param name="TemplateCode">Template ID</param>
        /// <returns>Obejct of EmailTemplate</returns>
        public TemplateMasterBO GetEmailTemplate(int TemplateCode)
        {
            TemplateMasterBO emailTemplate = new TemplateMasterBO();

            ObjectMapper.Map(EmailRepository.GetEmailTemplate(TemplateCode), emailTemplate);
            return(emailTemplate);
        }
Ejemplo n.º 2
0
        public ActionResult SendEmailWithAttachment(string mailTo, string mailTo2, int contactid, int type)
        {
            var email = string.Empty;

            if (!mailTo.IsStringNullOrEmpty())
            {
                email += mailTo;
            }
            if (!mailTo2.IsStringNullOrEmpty())
            {
                email += ";" + mailTo2;
            }
            var model = new MailModel
            {
                To        = email,
                TypeEmail = type,
                ContactId = contactid
            };
            var info = EmailRepository.GetEmailTemplate(type);

            model.Subject = info.Subject;
            model.Body    = info.Content;
            var user = UserContext.GetCurrentUser();

            if (user != null && !user.SignEmailSend.IsStringNullOrEmpty())
            {
                model.Body += "<br />" + user.SignEmailSend;
            }
            if (type == 4)
            {
                string chuoi = "";
                chuoi         = "<input type=\"checkbox\" name=\"anh_041\" value=\"\" checked=\"true\" disabled=\"disabled\">huongdantestphongvan04.png";
                chuoi        += "</br>";
                chuoi        += "<input type=\"checkbox\" name=\"docx_042\" value=\"\" checked=\"true\" disabled=\"disabled\">CASEC_Huongdandanhchothisinh04.docx";
                ViewBag.html4 = chuoi;
            }
            else
            {
                ViewBag.html4 = "";
            }

            if (type == 7)
            {
                string chuoi = "";
                chuoi         = "<input type=\"checkbox\" name=\"anh_071\" value=\"\" checked=\"true\" disabled=\"disabled\">huongdantestphongvan07.png";
                chuoi        += "</br>";
                chuoi        += "<input type=\"checkbox\" name=\"docx_072\" value=\"\" checked=\"true\" disabled=\"disabled\">Huongdansudungbaithilythuyet.doc";
                ViewBag.html7 = chuoi;
            }
            else
            {
                ViewBag.html7 = "";
            }

            if (type == 6)
            {
                string sb;
                sb            = "<input type=\"checkbox\" name=\"\" value=\"\" checked=\"true\" disabled=\"disabled\">File lộ trình học tập SB100";
                ViewBag.html6 = sb;
            }
            else
            {
                ViewBag.html6 = "";
            }
            return(View(model));
        }