andrewdavey / postal

Email sending for asp.net mvc using the view engine system to render emails.
http://aboutcode.net/postal
MIT License
536 stars 168 forks source link

Support views stored in Areas #88

Open zabeda opened 10 years ago

zabeda commented 10 years ago

We are using Areas for a project and wanted to be able to have the Emails folder stored in the Area instead of off the root.

This change lets you add the name of an Area to the Email object using either a new constructor or by using an AreaName property. If populated, the EmailViewRender puts the AreaName in the DataTokens of the RouteData object. Once there, the folder ~/[AreaName]Views/Emails/ is included in the search for the view named in the Email object.