andrewdavey/postal — Issue #26: fully qualified viewnames + alternative views are not handled correctly
Author: bschapendonk
Created: 2011-10-13 08:37:20+00:00
State: open

**~/Views/Emails/Test.cshtml** with **Views: Text, Html** resolves to **~/Views/Emails/Test.cshtml.Html** and **~/Views/Emails/Test.cshtml.Text**

My work around is overriding the FindView of RazorViewEngine and creating a EmailService() with this viewengine

```c#
private class MyRazorViewEngine : RazorViewEngine
{
public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
{
if (viewName.Contains(".cshtml.") && !viewName.EndsWith(".cshtml", StringComparison.OrdinalIgnoreCase))
viewName = viewName.Replace(".cshtml.", ".") + ".cshtml";
return base.FindView(controllerContext, viewName, masterName, useCache);
}
}
```