I would like to use my Razor view as some kind of template for sending emails, so I would like to "save" my template in a view, read it into controller as a string, do some necessary replacements, and then send it.
I have solution that works: my template is hosted somewhere as an HTML page, but I would like to put it into my application (i.e. in my view). I don't know how to read a view as a string in my controller.
I use the following. Put it on your base controller if you have one, that way you can access it in all controllers.
Take a look at the RazorEngine library, which does exactly what you want. I've used it before for email templates, and it works great.
You can just do something like this: