andrewdavey/postal

How to add external link with params?

Opened this issue · 2 comments

Reksy commented

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?

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.

"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"