Razor email-template: show only last digits of account numer
Hello everyone,
In the email Example-Template.cstml in \Views\Partials\Forms\Emails, I am trying to show only the last 4 digits of an account number, and mask the rest with * or x.
I found several javascript options online, but I didn't manage to get them to work with Razor. In most cases, the email wasn't sent at all. I have to admit my knowledge of both Razor and javascript is basic at best.
But I can't imagine I'm the first who tries to do this. Does anyone have a solution?
Razor email-template: show only last digits of account numer
Hello everyone,
In the email Example-Template.cstml in \Views\Partials\Forms\Emails, I am trying to show only the last 4 digits of an account number, and mask the rest with * or x.
I found several javascript options online, but I didn't manage to get them to work with Razor. In most cases, the email wasn't sent at all. I have to admit my knowledge of both Razor and javascript is basic at best.
But I can't imagine I'm the first who tries to do this. Does anyone have a solution?
Best, Jeroen
Hi,
You might want something like this:
So if your account number is
1234 5678 9101 1121
you would get
**** **** **** 1121
Thank you, that worked great! (Could have saved myself a week of trying by posting on here immediately).
Thanks, Jeroen
is working on a reply...