Rename default layout to MailerLayout or (ScaffoldName)Layout
Opened this issue · 2 comments
this issue was posting here:
it really is strange, because 90% of my messages aren't effected, however, the one that was effected i just burned a day on trying to figure this out. I'd suggest you rename the default name of the layout that gets scaffolded to match the name of the mailer object.
So, this is definitely a bug, and I really don't understand where it's happening, but I had one email where it would always try to pull the layout out of the viewstart. I tried everything -- setting it in the view, setting the mastername to null in the controller, and nothing seemed to work. This is what I ended up doing which works but it is a complete hack :)
in my _ViewStart.cshtml:
@{
Layout = "/Views/Shared/_Layout.cshtml";/Views/UserMailer/_MailerLayout.cshtml";
var child = this.ChildPage.ToString().ToLower();
here itif (child.Contains("usermailer"))
{
Layout = "
}
}
works okay, but if you had multiple mailers that would obviously be a pain to maintain... any ideas on whats causing this? what's stranger is that i had 1 successful send of this email today before I implemented this fix.
ya i guess that didnt work (another example of the inconsistency in this issue...), really weird, only one route is doing this... any ideas?