Hello @wipx,
The easiest way to do that is using telephone parts mail-tags this plugins provides in your mail panel instead the default mail-tag (that returns the complete number including the plus symbol: +):
- [{your-phone}-cf7it-country-code]: It prints the country code of the phone number. For the example above: 1
- [{your-phone}-cf7it-national]: It prints the phone number without international prefix. For the example above: 5551234567
You need to replace {your-phone}
part of mail-tags with the name of your form-tag. This is an example of how it’s use:
[...]
Customer Phone: [your-phone-cf7it-country-code][your-phone-cf7it-national]
[...]
Another way is to remove the symbol before the mail processing. To achieve this you can use this code in the functions.php
file of your active theme or in a custom plugin:
add_filter(
'wpcf7_mail_tag_replaced',
function ($replaced, $submitted, $html, $mail_tag) {
if ('your-phone' == $mail_tag->field_name()) {
$replaced = preg_replace('+', '', $replaced);
}
return $replaced;
},
10,
4
);
You needs to replace 'your-phone'
with the name of your phone form-tag. In both method, you’ll get a mail with something like this:
[…]
Customer Phone: 15551234567
[…]
I hope it’s useful to you.