예제 #1
0
        public static Email WithTemplateBody(this Email email, string templateName, IDictionary <string, string> placeHolderValues = null, bool isHtml = true)
        {
            var body = new TemplateBody()
            {
                TemplateName = templateName, IsHtml = isHtml
            };

            if (placeHolderValues != null)
            {
                foreach (var key in placeHolderValues.Keys)
                {
                    body[key] = placeHolderValues[key];
                }
            }
            email.Body = body;
            return(email);
        }
예제 #2
0
 public static Email WithTemplateBody(this Email email, string templateName, IDictionary<string, string> placeHolderValues = null, bool isHtml = true)
 {
     var body = new TemplateBody() { TemplateName = templateName, IsHtml = isHtml };
     if (placeHolderValues != null)
     {
         foreach (var key in placeHolderValues.Keys)
             body[key] = placeHolderValues[key];
     }
     email.Body = body;
     return email;
 }