I just released a .Net NuGet package called MvcMailer and to get people super easily started, put an article at CodeProject.com. You are most welcome to the article at http://www.codeproject.com/KB/aspnet/MvcMailerNuGet.aspx
I welcome your comments and suggestions!
I welcome your comments and suggestions!
I also added multi-part emails in version 0.8. You may check that out as well.
One important change:
mail.Body = PopulateBody(mail, "welcome") needs to be replaced with PopulateBody(mail, "Welcome"), it gets rid of the duplication
routes.Add("Account", new Route("{account}/{controller}/{action}/{id}",
new RouteValueDictionary(new { account = "", controller = "Home", action = "Index", id = "" }), new AccountMvcRouteHandler()));
I'm trying to render a link:
href="@Url.Abs(Url.Action("About", "Home"))"
The url that is generated looks like:
http://mysite/Home/About
instead of
http://mysite/myaccount/Home/About
I know a solution to your problem now. But I would like to make sure I know the problem in detail.
PS. Congratulations on joining ThoughtWorks
Will you release a new version through NuGet? I will be able to upgrade easily and test it for you.
Cheers!
Jakub
Thirst of all, thank you for a brilliant package! It's simple and easy to use!
I've just found one little issue - I've notices that the ControllerContext for Notifier doesn't have the RouteData dictionary populated with the same values as the RouteData for main controller. This causes UrlHelper to generate invalid Urls. My app is a multi-tenant one and all my routes have format: /{account}/{controller}/{action}/ I've managed to 'fix' it by adding following code in the WelcomeMessage.cshtml
@{
this.Url.RequestContext.RouteData = (this.Context.CurrentHandler as MvcHandler).RequestContext.RouteData;
}
I wonder if you could fix it properly, then MvcMailer will be just perfect! ;-)
Thank you,
Jakub