Corrected Email Templates and Master Layouts

I use the spark vision mechanism outside of MVC to create HTML emails. I pulled the general layout elements into the master view (template) (Application.spark) and accessed the main view from my * .spark files using <use master="Application.spark"> . However, the HTML in the main view is not displayed in my letters. Any ideas how to do this? Is it possible?

+4
source share
2 answers

Spark does not need MSMVC specifically for master layouts and views to work together.

But unless you specifically provide your own version of IDescriptorFilter , IDescriptorFilter will be used, and it expects the Application.spark file to be in a folder named Shared or Layouts under the main Views . If it is located in one of these two, you do not even need to refer to it from any of your *.spark files, it will be used traditionally because of its name and location.

What about everything that I can say from the information you provided, but I think it could be something else, and I will need to see some code or example to help more ...

Hope this helps, Rob

+1
source

I solved this by adding Application.spark as a template in descriptor :

 descriptor.AddTemplate("Application.spark"); 

and used ${Content["view"]} instead of <use content="view"/> in the template.

Let me know if you have any problems after trying it.

The CodePlex website also has a work item: http://sparkviewengine.codeplex.com/workitem/9035

0
source

All Articles