Closed pantsclunk closed 11 years ago
If I change the name of the layout page and set that name in the UserMailer.cs file it works fine. Not sure why I have to change the name. It seems to get confused if there is another file named _Layout. Closing issue.
Thanks for a great product! :)
This doesn't fix the issue for me. Every once and a while it will use the correct layout however but then it always goes back to using the sites layout again.
This worked for me! Thank God. Couldn't figure out for the life of me what was wrong! I hope others find this when googling. It took me a while to find.
Ignoring Layout at page level. Defauting to _viewstart layout. Change name of mailer layout, rebuild, and you're good.
Thank you thank you thank you
Hi, changing the name is not working for me, either. Any suggestions?
Did you try changing the MasterName in the constructor of you CS file ?
That worked for me
I have this code in my Welcome email file Welcome.cshtml
@{ Layout = "~/Views/UserMailer/_Layout.cshtml"; }
HTML View for UserMailer#Welcome
It sends the mail, however it is using the layout file for my website rather than the email layout file. Am I doing something wrong? If so, how can I get it to use the mailer _Layout template file?
This is the body of the email. Notice it is using the website layout file rather than the email layout file?
your logo here • Register • Log in • Home • About • Contact HTML View for UserMailer#Welcome © 2013 - My ASP.NET MVC Application
Thanks