Reputation: 1977
I have a report displayed on the Screen and would like to be able to send it content via email when user press SendEmail link. I have installed MVCMailer and trying to send it but it arrives as empty message. When I follow the example in here it works. But I don't want to send View from UserMail folder. How can I send the View from other folder?
public virtual MvcMailMessage Welcome()
{
return Populate(x =>
{
x.Subject = "Welcome";
x.ViewName = "Graph\List"; // Controller: Graph, View: List
x.To.Add("[email protected]");
});
}
Upvotes: 1
Views: 307
Reputation: 21
You can override the base class virtual property "MailerName" by returning the desirable view location name.
MvcMailer has a MailerName property which is virtual in base class. and MvcMailer class uses this property for finding the view in the location available to this property, In your case this property will have the value "UserMail" and MvcMailer will try to find view in UserMail foler.
So overriding this property with desirable location will make mvc framework to find the view in the given location.
Upvotes: 2