smsohan / MvcMailer

A Mailer for ASP.Net MVC that forms the Email Body using MVC Views (Razor etc.) following Ruby on Rails ActionMailer style
MIT License
585 stars 176 forks source link

Why does MvcMailer try to match a route when sending email? #88

Open jancg opened 11 years ago

jancg commented 11 years ago

This is actually my first attempt at using MvcMailer. It is already being used in several of our companies projects and working fine. My first implementation (the view for the email only contains plain text, so nothing to use routing for) refuses to work because it tries to resolve a route (the exact route of the current controller being emailed from) and that route has become invalid in the meantime. (That route having become invalid is NOT the issue, it is a given fact.)

My question is; why does MvcMailer try to resolve a route when sending an email. Is it because of the use of the HttpContext?

Jan C. de Graaf

smsohan commented 11 years ago

Yup, to find the view file it needs to use the context. Unfortunately, this is a method from ASP.NET core that needs the context.


Sent from my iPhone Sohan SM

On 2013-02-27, at 3:59 AM, jancg notifications@github.com wrote:

This is actually my first attempt at using MvcMailer. It is already being used in several of our companies projects and working fine. My first implementation (the view for the email only contains plain text, so nothing to use routing for) refuses to work because it tries to resolve a route (the exact route of the current controller being emailed from) and that route has become invalid in the meantime. (That route having become invalid is NOT the issue, it is a given fact.)

My question is; why does MvcMailer try to resolve a route when sending an email. Is it because of the use of the HttpContext?

Jan C. de Graaf

— Reply to this email directly or view it on GitHubhttps://github.com/smsohan/MvcMailer/issues/88 .