ASP.NET is great for creating html. We send out a lot of html email messages. In the past we've been loading .html templates with key strings that are replaced to make the email more custom (ie. [[FirstName]] would be replaced with "John Doe"). However as we are adding more and more email campaigns the logic to customize the email is starting to get out of hand. Instead of a simple [[FirstName]] string replace we are tasked with something like [[ScholarshipList]] where the ScholarshipList is different for each user we send an email to.
Ideally, at least in my mind, these email templates would be self contained .aspx pages. And would be invoked from our winform emailer application in a manner similar to
IEmailTemplate template = EmailTemplates.Load("ScholarshipList.aspx");
template.UserID=1234;
string emailMessage = template.Render();
Then the ScholarshipList.aspx page would look similar to any other asp.net page in that it can have server controls, runat="server" scripts and databind.
I've seen this article http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime.asp which looks promising. Has anyone used it before? It uses some remoting which ideally would be avoided, and has a limited error handling mechanisms. I thought I'd get some other feedback before I went to far down that road.