andrewdavey / postal

Email sending for asp.net mvc using the view engine system to render emails.
http://aboutcode.net/postal
MIT License
536 stars 168 forks source link

Behavior in site using areas #111

Open ghost opened 9 years ago

ghost commented 9 years ago

I currently have this cod to send the email

var sendEmail = new EmailRegisterViewModel
  {
      EmailProp = new EmailProperties 
          {
                To = model.Email,
                Msg = "derp",
                ViewName = "ConfirmRegistration",
           },
        CallBackUrl = callbackUrl,
        UserName = model.Username
   };
 sendEmail.Send();

The ViewName does not get picked up and throws an error if i do not name the view to be used EmailRegisterViewModel . I am not sure if this has got to do with the fact that i am using areas to define my sections. It is still looking in the base views folder, but not for the assigned name.

It also requires a _Layout.cshtml ( There is no point in having a _Layout file in the base views folder and all the sections of the site are held in areas with there own _Layouts ) even though the _ViewStart.cshtml is @{ Layout = null; }

I can still send , and everything works , just curious to its behavior