Ejemplo n.º 1
0
 public static EmailTemplate ComposeTemplate(string emailTemplatePath, ParameterCollection parameters)
 {
     XmlEmailTemplate xmlTemplate = new XmlEmailTemplate(emailTemplatePath);
     StringTemplateEmailFormatter formatter = new StringTemplateEmailFormatter();
     return formatter.Format(xmlTemplate, parameters);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sends the XML mail using string template formatter.
 /// </summary>
 /// <param name="xmlTemplate">The XML template.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="sender">The sender.</param>
 public static void SendXmlMailUsingStringTemplateFormatter(XmlDocument xmlTemplate, ParameterCollection parameters, IEmailSender sender)
 {
     EmailTemplate template = new XmlEmailTemplate(xmlTemplate);
     IEmailFormatter formatter = new StringTemplateEmailFormatter();
     sender.Send(template, formatter, parameters);
 }