jonleigh / RazorMailer

A lightweight framework for sending emails from any .NET platform using Razor templates. Built on top of RazorEngine.
MIT License
47 stars 11 forks source link

[Feature Request] Support for absolute urls #17

Closed robgha01 closed 7 years ago

robgha01 commented 7 years ago

A example of this can be found here: https://github.com/smsohan/MvcMailer/blob/d40e1d161533022b9e2322f156014b29fa090c75/Mvc.Mailer/ExtensionMethods/UrlHelperExtensions.cs

we need some sort of function to convert any url to absolute as relative urls will not work in a email.

jonleigh commented 7 years ago

Hi

Under the hood, this requires that you have a variable in AppSetttings called MvcMailer.BaseUrl - which feels a little dirty and could cause you to have multiple variables containing your root domain.

Wouldn't it be better to pass the root of your website as a variable in the model? Or create a base model that has a property which accesses the property from AppSetttings? That way, it's under your control.

jonleigh commented 7 years ago

Hi. Going to close this issue now, let me know if you want to discuss further.