Closed mattfraley closed 12 years ago
I guess I spoke too soon. In the UserMailer class, I commented out "MasterName="_Layout"; and it worked just fine.
Thanks for a great product!
How did I miss that?! Thanks just what I was looking for!
This didn't work for me. Any other ideas?
This didn't work for me either.Now mvcmailer start using the master_layout.
didn't work for me too.
Rename the _Layout.cshtml in your mailer folder to something else such as _LayoutMailer.cshtml
Rename the MasterName in your mailer constructor to the same as follows:
public class UserMailer : MailerBase
{
public UserMailer()
{
MasterName = "_LayoutMailer";
}
...
}
I am using MVC areas for my administration. When I send an email from a controller in the admin area, it uses the _Layout.cshtml from the admin area, rather than the _Layout.cshtml in the Views\UserMailer folder. Even if I specify the Layout in the view like below, it still uses the _Layout in the admin area.
@{ Layout = "~/Views/UserMailer/_Layout.cshtml"; }