Title: Special Fields
Last modified: January 29, 2018

---

# Special Fields

 *  [leveltgp](https://wordpress.org/support/users/leveltgp/)
 * (@leveltgp)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/)
 * Hello, I have created the form in the url. Like the filed bellow I take the data
   in a xml , csv file but with the number (“1, 2,3”) as you can see bellow.
    [radio
   entry-sex id:entry_sex default:1 “Κανένα|1” “Αγόρι|2” “Κορίτσι|3”] But in the
   email where goes to admin email I want to have the word not the number (1= “Κανένα”,
   2 =”Αγόρι) etc. Σo in here : Φύλλο : [entry-sex] in email settings what must 
   I place so to have in email the words not the numbers? Thank you very much.

Viewing 11 replies - 1 through 11 (of 11 total)

 *  anonymized-15380454
 * (@anonymized-15380454)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-9912153)
 * Try:
 * `[radio entry-sex id:entry_sex default:1 “Κανένα” “Αγόρι” “Κορίτσι”]`
 *  Thread Starter [leveltgp](https://wordpress.org/support/users/leveltgp/)
 * (@leveltgp)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-9965425)
 * Hello, thank you for your answer.My goal here is to export data in a xml with
   the code number of the field (“Αγόρι|2”) here is number “2”and it is done but
   the email which goes to admin email, and customer after submission to have the
   text(“Αγόρι”) no the code “2” as it goes to xml.
    So I need a combination here.
   Any thoughts? Thank you again.
 *  anonymized-15380454
 * (@anonymized-15380454)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10001627)
 * Let me know if you still need help with this.
 *  Thread Starter [leveltgp](https://wordpress.org/support/users/leveltgp/)
 * (@leveltgp)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10001749)
 * Hello, thank you for your answer. Yes I still need help on this cause till now
   I have not found a way to send the text and not the number to admin / client 
   email. It sends the number of the field not the text see my previous answer Iam
   explaining what I have done so far and it iks working and what I need as last
   solution. Thank you very much again for you timne.
 *  anonymized-15380454
 * (@anonymized-15380454)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10001763)
 * You are using the latest version of Contact Form 7, right?
 *  Thread Starter [leveltgp](https://wordpress.org/support/users/leveltgp/)
 * (@leveltgp)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10001797)
 * Yes of cource, 4.7 is the version I use.
    But as you can see the fields have 
   titles(texts), and text fields where client type informations. In the xml it 
   goes the cobe number of the field no the text, but also the code number of the
   field goes to admin email. My goal here is to send the text in admin email and
   the code number to the xml as is hapens now. See a code of the form bellow.
 * Sex [radio entry-sex id:entry_sex default:1 “Αγόρι|2” “Κορίτσι|3”]
 *  So in this field “Αγόρι|2” “Κορίτσι|3”] in the xml I receive number 2 or 3 according
   what client will choose but in admin email also I receive the number not the 
   text “Text =Αγόρι|number =2” “Text = Κορίτσι|Number =3”]
 *  anonymized-15380454
 * (@anonymized-15380454)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10001897)
 * Yes, I understand what you need.
 * But when I said “_the latest version of Contact Form 7_“, I was actually referring
   to [version 5.0](https://wordpress.org/plugins/contact-form-7/).
 * But then, don’t worry, please give me some time and I’ll get back with a code
   snippet you can try.
 *  Thread Starter [leveltgp](https://wordpress.org/support/users/leveltgp/)
 * (@leveltgp)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10001913)
 * Thank you very much wait for your update
 *  anonymized-15380454
 * (@anonymized-15380454)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10002040)
 * So here’s the code snippet:
 *     ```
       add_filter( 'wpcf7_special_mail_tags', function ( $output, $name, $html ) {
       	if ( 'entry-sex-label' === $name
       	&& ( $submission = WPCF7_Submission::get_instance() ) ) {
       		$tags = wpcf7_scan_form_tags( array(
       			'name' => 'entry-sex',
       		) );
   
       		if ( isset( $tags[0] ) && $tags[0] instanceof WPCF7_FormTag ) {
       			$p_labels = $tags[0]->pipes->collect_befores();
       			$p_values = $tags[0]->pipes->collect_afters();
   
       			$values = $submission->get_posted_data( 'entry-sex' );
       			if ( isset( $values[0] ) ) {
       				$key = array_search( $values[0], $p_values );
       				if ( false !== $key ) {
       					return $p_labels[ $key ] ?? '';
       				}
       			}
       		}
       	}
       	return $output;
       }, 10, 3 );
       ```
   
 * If you are _familiar_ of doing this, add the snippet to the theme’s _functions.
   php_ file. Otherwise (or for quick testing), you can use [My Custom Functions](https://wordpress.org/plugins/my-custom-functions/).
 * In the email’s “[Message body](https://contactform7.com/setting-up-mail/)“, you
   can use:
    - [entry-sex] — Displays the `value` of the selected option. (e.g. `2` _or_ `
      3`)
    - [entry-sex-label] — Displays the _label_ of the selected option. (e.g. `Αγόρι`
      _or_ `Κορίτσι`).
 * Let me know if you need further assistance.
    -  This reply was modified 8 years, 6 months ago by anonymized-15380454.
 *  Thread Starter [leveltgp](https://wordpress.org/support/users/leveltgp/)
 * (@leveltgp)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10002057)
 * Thank you very much, I will update you with the results.
 *  Thread Starter [leveltgp](https://wordpress.org/support/users/leveltgp/)
 * (@leveltgp)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10010043)
 * Hello, thank you very much for your help so far, I install plugin My custon functions,
   placed the code and in message body [entry-sex-label] but in email it does not
   send the text here is the form I receive
    Όνομα : ΙΩΑΝΝΗΣ Επίθετο : ΦΕΛΛΑΣ Φύλλο:[
   entry-sex-label] Ημερομηνία Γέννησης : 02/15/2018 As you can see it sends [entry-
   sex-label] not the label and in message body I placed it : here is the message
   body Όνομα : [your-name] Επίθετο : [your-lastname] Φύλλο : [entry-sex-label] 
   Ημερομηνία Γέννησης : [birthdate] Όνομα πατέρα : [father-name]
 * If you have another solution I will be gratefull to hear it from you. Thank you
   very much for your time and help so far.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Special Fields’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [leveltgp](https://wordpress.org/support/users/leveltgp/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/special-fields-2/#post-10010043)
 * Status: not resolved