Communication IEmailsCommand.GeneratePreview(TemplateEmail email, TemplateContentItem templateContentItem) { var copyItemEngine = _templateEngine.GetCopyItemEngine(templateContentItem); var context = new TemplateContext { Id = email.Id }; var copyItem = _templateEngine.GetCopyItem(copyItemEngine, context, email.Properties, null); return(email.CreateCommunication(copyItem)); }
CopyItem ITemplateEngine.GetCopyItem(TemplateContext context, TemplateProperties properties, string[] mimeTypes) { return(_secondTemplateEngineNames.Contains(context.Definition) ? _secondTemplateEngine.GetCopyItem(context, properties, mimeTypes) : _firstTemplateEngine.GetCopyItem(context, properties, mimeTypes)); }