I have the following RazorEngine call:
public class RazorEngineRender
{
public static string RenderPartialViewToString(string templatePath, string viewName,
Here are a few hints you might try:
Make your razor view strongly typed to a model:
@model Foo
Link:
@Model.ActivationLink
When rendering it pass a Foo
model:
_emailService.Render(
TemplatePath,
"Email.cshtml",
new Foo { ActivationLink = activationLink }
)
If you are trying to send emails from your Views make sure you checkout Postal before reinventing something.