public void TestFixtureSetUp() { var templateService = new TemplateService(); var embeddedEmailResourceProvider = new EmbeddedEmailResourceProvider( typeof(SimpleEmailModel).Assembly, "Email.RazorTemplates", "Email.Images", "en-AU"); _emailTemplateInitializer = new RazorEmailTemplateInitializer(embeddedEmailResourceProvider, templateService); _emailFormatter = new RazorEmailFormatter(templateService, _emailTemplateInitializer); }
public static IEmailFormatter AnInitializedEmailFormatter() { if (initializedEmailFormatter == null) { var templateService = new TemplateService(); var embeddedEmailResourceProvider = new EmbeddedEmailResourceProvider( typeof(SimpleEmailModel).Assembly, "Email.RazorTemplates", "Email.Images", "en-AU"); var emailTemplateInitializer = new RazorEmailTemplateInitializer(embeddedEmailResourceProvider, templateService); emailTemplateInitializer.CompileTemplatesForTypesInSameNamespaceAs <SimpleEmailModel>(); initializedEmailFormatter = new RazorEmailFormatter(templateService, emailTemplateInitializer); } return(initializedEmailFormatter); }
public static IEmailFormatter AnInitializedEmailFormatter() { if (initializedEmailFormatter == null) { var templateService = new TemplateService(); var embeddedEmailResourceProvider = new EmbeddedEmailResourceProvider( typeof(SimpleEmailModel).Assembly, "Email.RazorTemplates", "Email.Images", "en-AU"); var emailTemplateInitializer = new RazorEmailTemplateInitializer(embeddedEmailResourceProvider, templateService); emailTemplateInitializer.CompileTemplatesForTypesInSameNamespaceAs<SimpleEmailModel>(); initializedEmailFormatter = new RazorEmailFormatter(templateService, emailTemplateInitializer); } return initializedEmailFormatter; }