# Only show last 3 digits of bank number... possible?

**URL:** <https://forum.mautic.org/t/only-show-last-3-digits-of-bank-number-possible/28545>\
**Category:** General Discussion\
**Tags:** development, email\
**Created:** [July 7, 2023, 11:33am UTC](https://forum.mautic.org/t/only-show-last-3-digits-of-bank-number-possible/28545 "2023-07-07T11:33:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stgoos](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stgoos/32/8149_2.png) [@stgoos](https://forum.mautic.org/u/stgoos)\
**Post date:** [July 7, 2023, 11:33am UTC](https://forum.mautic.org/t/only-show-last-3-digits-of-bank-number-possible/28545/1 "2023-07-07T11:33:40Z")

</div>

We have the bank account number stored in a custom field but when using it in emails we want/need to show only the last 3 digits of the bank account with a \* in front of it (e.g. \*456).

Is it somehow possible to mask data of a custom field when using it in an email?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [July 7, 2023, 11:43am UTC](https://forum.mautic.org/t/only-show-last-3-digits-of-bank-number-possible/28545/2 "2023-07-07T11:43:06Z")

</div>

You can create a custom token: `{emailbanknumber}`, which looks up this custom field and replaces the mentioned token with just 3 digits.

Or you can just create another field that contains last three numbers of the bank account - and then use that field in email.

---

<div class="post-metadata">

**Author:** ![stgoos](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stgoos/32/8149_2.png) [@stgoos](https://forum.mautic.org/u/stgoos)\
**Post date:** [July 7, 2023, 12:32pm UTC](https://forum.mautic.org/t/only-show-last-3-digits-of-bank-number-possible/28545/3 "2023-07-07T12:32:28Z")

</div>

Ok - I’m totally new to custom tokens. Will have a look into it.

If you can share tips that would of course be welcome.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [July 9, 2023, 4:36pm UTC](https://forum.mautic.org/t/only-show-last-3-digits-of-bank-number-possible/28545/4 "2023-07-09T16:36:21Z")

</div>

Hi, I wrote a simple plugin for you, which does what you asked for: \< [GitHub - mzagmajster/mautic-token-bundle: Add custom token to Mautic](https://github.com/mzagmajster/mautic-token-bundle) \>.

Most of the magic happens here: `EventListener/EmailSubscriber.php`, plugin needs field iban to function correctly and it registers a custom token: `{ibanmasked}`

Here is a screenshot from email:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/514df9d407dffd32dbb95bdd797430b9b4460b83.png)

Regards, M.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [August 1, 2023, 10:42am UTC](https://forum.mautic.org/t/only-show-last-3-digits-of-bank-number-possible/28545/5 "2023-08-01T10:42:57Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
