MvcMailer view in browser
I am using MvcMailer with my website to send html emails. seems good, but im just w开发者_运维问答ondering how i can view the created emails in a browser.
eg in some newsletters they say "view this email in a browser", so i am just wondering how I can do that with MvcMailer.
The easiest way is to put a link in the email back to your site, and then create a controller/action that uses the same view, and builds a model the same as the one you used when creating the email.
If all the data you need is in the database, you may be able to just pass a key in the querystring (note: if the mail contains potentially sensitive information, make sure the url is tamper-proof), otherwise you might need to pass in more data to allow you to reconstruct the same view that you did when generating the email.
精彩评论