我的 Kentico 服务器无法发送电子邮件,所以我必须使用 MacroResolver 转换我的电子邮件,但使用其他方式发送。
var clients = new List<Client>();
var macroResolver = MacroResolver.GetInstance();
macroResolver.AddDynamicParameter("clients", clients);
var emailMessage = new EmailMessage {
From = "someone@somewhere.com",
Recipients = "otherone@somewhere.com",
Subject = "Whatever"
};
var template = EmailTemplateProvider.GetEmailTemplate(templateName, siteName);
EmailSender.SendEmailWithTemplateText(siteName, emailMessage, template, macroResolver, true);
换句话说,我想将 Kentico 用作模板引擎。有没有办法做到这一点?