add_filter('wpcf7_mail_components', function($components, $contact_form) {
    if (!empty($components['body'])) {
        // Cerca una data nel formato YYYY-MM-DD e la converte in DD.MM.YYYY
        $components['body'] = preg_replace_callback(
            '/(\d{4})-(\d{2})-(\d{2})/',
            function ($matches) {
                return $matches[3] . '.' . $matches[2] . '.' . $matches[1];
            },
            $components['body']
        );
    }
    return $components;
}, 10, 2);