I tried doing that with Elementor form fields shortcode, and dynamic content php for email and its working with only shortcode sending namefield but if I am making any changes to output of shortcode it stops working and change shortcode itself anyhelp will be apprecieated,
$processed_name_shortcode = echo do_shortcode( '[field id="name"]' );
$email_shortcod = '[field id="email"]';
$email_shortcode = do_shortcode($email_shortcod);
// Extract the first 3 characters
$email_first3 = substr($email_shortcode, 0, 3);
// Calculate the number of asterisks needed
$email_asterisks = str_repeat('*', strlen($email_shortcode) - 3);
// Concatenate the first 3 characters with the asterisks
$masked_email_shortcode = $email_first3 . $email_asterisks;
echo '<a href="#" class="button">' . esc_html($masked_email_shortcode) . '</a>';