Пример #1
0
        public EmailMessage CreateEmailMessage(EmailView emailView)
        {
            var renderer       = GlobalConfiguration.Configuration.DependencyResolver.GetService <IEmailViewRenderer>(emailView.RendererName);
            var rawEmailString = renderer.Render(emailView);
            var result         = EmailParser.CreateMailMessage(rawEmailString);

            result.Body = ToSingleLine(result.Body);
            return(result);
        }
Пример #2
0
        public string Render(EmailView email, string viewName = null)
        {
            viewName = viewName ?? email.ViewName;
            var controllerContext = CreateControllerContext();
            var view       = CreateView(viewName, controllerContext);
            var viewOutput = RenderView(view, email.ViewData, controllerContext);

            return(viewOutput);
        }
Пример #3
0
        public EmailView CreateEmailView(string viewName, object model = null)
        {
            var email = new EmailView(viewName, model);

            return(email);
        }