andrewdavey / postal

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

Is it possible to configure the email views location? #133

Open jfrank14 opened 8 years ago

jfrank14 commented 8 years ago

It seems to be defaulting to ~/Views/Emails, but for various reasons I need to change this and I can't find a way to do so. Is this configurable or hardcoded?

andrewdavey commented 8 years ago

You can create an instance of EmailService using the constructor that accepts an IEmailViewRenderer. EmailViewRenderer has a property called EmailViewDirectoryName that you can assign to a name other than "Emails".

Another option is to explicitly set the ViewName property of an Email object to be a full view path e.g. "~/Custom/Email.cshtml"

jfrank14 commented 8 years ago

Ah, perfect. Thanks!