I would like to generate emails using the Razor view engine.
From what I've read, I can use these OS projects to do that from my website:
However, all these use example where the user submits a form and an email is sent from the contoller. When creating the email a ControllerContext seems to be required. I am hoping to do the generating within my "Service" layer at periodic intervals, so I doubt I have access to the ControllerContext.
Is this doable?
so what i use to get razor outside asp.net is the razor engine found on codeplex: RazorEngine
Check this out. I'm using it with templates as embedded resources like this (but can be modified to locate templates anywhere):
model:
template:
I have for each template it's own model, so its easy to locate them via class name. Also I was unable to make intellisense work.