TemplateCodePage not found

I have a templates .html page that calls a TemplateCodePage however I’m gettting an exception message

“Partial was not found: ‘reminder’”

this is my .html file

<h3>Document Reminder</h3>

<p class="sub-info">
    {{'reminder' | partial({userDocumentReminder: userDocumentReminder})}}

and this is the TemplateCodePage (with the render content omitted)

public class UserDocumentRemindersPage : TemplateCodePage
    string render(UserDocumentReminder userDocumentReminder) => $@";

The documentation suggests that the TemplateCodePages are scanned for and added when the plugin is added, how can I verify this?


Only the ServiceHost assembly is scanned, if it’s in a different assembly you’ll need to specify either the Type in ScanTypes collection or the Assembly where it’s located in the ScanAssemblies collection, see the examples in the filter registration docs for reference:


Thanks, that worked.

I was just wondering is executing the code below inefficient every time I want to refer to an email html template?

   var templateContext = new TemplateContext
        VirtualFiles = base.VirtualFiles,
        ScanAssemblies = {typeof(UserDocumentRemindersPage).Assembly}

That code scans the assembly looking for types, if you use ScanTypes instead it won’t do any Assembly scanning.