I have an mvc 3 application with a background thread checking the status of some database items. When it finds an expired item, it sends an email. In an email, I would like to provide a url to call the call to view the status. If this was done from a controller, I would use UrlHelper, for example:
string body_url = "For more details see: " + Url.Action("Details", "MyOrder", new { OrderId = order.OrderId }, Constants.HttpProtocol);
However, I am not in the controller, and my method is not called from the controller, it starts when the application starts. Is there a way to generate a valid UrlHelper or, if not, generate a valid URL without resorting to hard coding, regardless of the controllers?
source
share