Viewing 6 replies - 1 through 6 (of 6 total)
  • Delfynn,

    You may want to try the suggestion from dimitrisilva at the following post.

    Best of luck.

    Thread Starter Delfynn

    (@delfynn)

    Thanks Mike,

    But this is the code that I’m using as you can see here:

    $submission = WPCF7_Submission::get_instance();

    if ($submission) {

    $posted_data = $submission->get_posted_data();

    $codepostal = $posted_data[‘Codepostal’];
    $Nomdumodele = $posted_data[‘Nomdumodele’];
    $nomdelamarque = $posted_data[‘nomdelamarque’];

    This line: $nomdelamarque = $posted_data[‘nomdelamarque’]; display the email cause is a select like this:

    [select nomdelamarque “CEO|ceo@example.com”
    “Sales|sales@example.com”
    “Support|support@example.com”]

    So I want get CEO and not the email address. And When I use this: $nomdelamarque = $posted_data[‘_raw_nomdelamarque’]; it’s don’t working.

    Thank you 🙂

    Anyone figured this out? I am having the same problem.

    Have a hook in the functions.php page of wordpress but using $posted_data[‘_raw_variable’] does not get the value before the pipe but the $posted_data[‘variable’] works fine

    Thread Starter Delfynn

    (@delfynn)

    Hi phoenixCoder,

    On your Contact Form settings you can make:
    [select* your-field
    “CEO|CEO <email address>, <email address>…”
    “Admin|Admin <email address>, <email address>…”]

    So email address is hidden.

    and in your file functions.php $posted_data[‘_raw_variable’] works 🙂

    Hi Delfynn,

    You obviously did not read my question. I already mentioned that $posted_data[‘_raw_variable’] in functions.php does NOT work.

    Yes my contact form 7 has the correct format and the _raw_ works in the email sent from the contact form but not the functions.php page.

    Thread Starter Delfynn

    (@delfynn)

    Yes, I know it does’nt work, but you can make this in your file functions.php, when you want get posted_data

    $your-field = str_replace(“,”,” “, $posted_data[‘your-field’]);

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Capture post data and get value before | (selectable recipient with pipes)’ is closed to new replies.