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

How to add external link with params? #161

Open Reksy opened 7 years ago

Reksy commented 7 years ago

Hi, guys!

I try to sent recovery password link with 2 params, code and userId.

So callbackUrl when ForgotPasswordEmail is initialize look like this: https://sitename/Account/ResetPassword?userId=blablabla&code=blabla.

In view i try to put it like: @Model.callbackURL or <a href='@Model.callbackUrl'>

But when I open email in the client the link is: https://sitename/Account/ResetPassword?userId=blablabla&amp;code=blabla.

the symbol &amp; is not recognizing like & and in action I have just one not nullable param (userId).

How I should put the link?

Priddybroderickson commented 12 months ago

Hey there! To properly display the link, you can use HTML decoding for the ampersand symbol. Try using '@Html.Raw(HttpUtility.HtmlDecode(Model.callbackUrl))' in your view to decode the Website ampersand symbol and display the link correctly.

jhonmike8 commented 8 months ago

"Hey there! Looks like you're dealing with an HTML encoding issue. Try using Html.Raw to render the link without encoding. Like this:

html Copy code Link Text Hope this helps! Betflix #CodingChallenge #HTML"