I need help customizing customer incoming email

Hello.
I have a problem using the Gravity form and I need help.

I’m not good at English, so plz understand if my words are weird.

click page

this page, I would like the [*SS NUMBER or TAX ID NUMBER] to be displayed in XXX-XX-0000 format instead of numbers in incoming mail for customers. like a credit card number…

I want XXX-XX-0000 to only appear in emails received by customers.
We want all the numbers to appear in the emails the admins receive.

So I added the code below to my theme functions.php file. But it doesn’t work.


add_filter( 'gform_merge_tag_filter', function ( $value, $merge_tag, $modifier, $field, $raw_value, $format ) {
if ( $merge_tag != 'all_fields' && $modifier == 'mask' ) {
$value = 'XXX-XX-' . GFCommon::safe_substr( $text, 6, 4 );
}

return $value;
}, 10, 6 );

Is there anything else I need to do? Or if there is another way, please let me know.
Please tell me how I can set it up.

Thank you.

  • Reference
    Now [SS NUMBER or TAX ID NUMBER] field setting :
    General : Single Line Text
    Input Mask - Custom (
    --****)

Patch here is appending the value, that is wrong