• 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)

    Try:

    [radio entry-sex id:entry_sex default:1 “Καν?να” “Αγ?ρι” “Κορ?τσι”]

    Thread Starter leveltgp

    (@leveltgp)

    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)

    Let me know if you still need help with this.

    Thread Starter leveltgp

    (@leveltgp)

    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)

    You are using the latest version of Contact Form 7, right?

    Thread Starter leveltgp

    (@leveltgp)

    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)

    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.

    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

    (@leveltgp)

    Thank you very much wait for your update

    anonymized-15380454

    (@anonymized-15380454)

    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.

    In the email’s “Message body“, 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 6 years, 9 months ago by anonymized-15380454.
    Thread Starter leveltgp

    (@leveltgp)

    Thank you very much, I will update you with the results.

    Thread Starter leveltgp

    (@leveltgp)

    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.