• As the title states, I was wondering what the quickest route to achieve the following. I’m a bit of a beginner in the backend portion of WP so thanks in advance if my description is cloudy.

    I’m using the WP-Members plugin to integrate user registration into my site. When i visit the user tab, it shows the WP-Members Additional Fields below the other User information.

    I wanted to get Contact Form 7 to automatically include this user data when it sends out the email when a site form is submitted. (User fills in limited info, and the email recipient will automatically receive all their user info, saving the user a bunch of time.)

    Side note: i’ve added the Contact Form 7 – Dynamic Text Extension, and was going to try to use the [dynamictext dynamicname “CF7_get_current_user”] shortcode, and I have wp-includes/pluggable.php open but I’m kinda lost!

    So any direction on simply achieving the above would be great.

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Amar Pawar

    (@amarpawar2006)

    I am also looking for similar solution.

    I’m using the WP-Members plugin to integrate user registration into my site.
    Then I have 1 big form where ppl need to fill their personal info. I want Contact Form 7 to automatically fetch this user data from WP-Members Additional Fields and display as defaultvalue.

    Aerodev did you find solution for this?

    I am not a coder so any easier way would be great.

    Hi, I was also looking for a similar solution, and I made it.
    I hope you can understand my English.

    1) Make some WP-Members custom fields, like phone, zipcode, address, etc.

    2) Add following codes in your theme’s functions.php

    function wpcf7_form_tag_filter($tag){
    if(is_admin() || !is_array($tag)) return $tag;
    $name = $tag[‘name’];
    $user = wp_get_current_user();
    if($user) {
    if($name == ‘phone’) { $tag[‘values’] = (array) $user->phone; }
    if($name == ‘zipcode’) { $tag[‘values’] = (array) $user->zipcode; }
    if($name == ‘address’) { $tag[‘values’] = (array) $user->address; }
    }
    return $tag;
    }
    add_filter(‘wpcf7_form_tag’, ‘wpcf7_form_tag_filter’, 11);

    3) Use following shortcodes at Contact Form 7.

    [text* phone]
    [text* zipcode]
    [text* address]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Integrate WP-Members additional fields into contact form 7’ is closed to new replies.