I'm trying to pass some custom field data to contact form 7 - The billing address and name and email address.

I've created a function that pulls in these details from the database - is there an easy way I can send these details in an email when a forms sent?

Can I possible somehow pass the data to the form sending template.

Here is my function that pulls in the correct data.

function rinfo() {

if ( is_user_logged_in() ) {
    global $current_user;

      echo 'Username: ' . $current_user->user_login . "\n";
      echo 'User email: ' . $current_user->user_email . "\n";
      echo 'Address: ' . $current_user->shipping_address_1 . "\n";

  • You'll want to use the wpcf7_before-send_mail hook to access and inject your data. You can read This Article for more information, hope it helps!
    – Howdy_McGee
    Jan 16 '14 at 16:25
  • I'll look into that hook @Howdy_McGee
    – dannyw24
    Jan 16 '14 at 16:58

This plugin helped me solve my question - It pulls in all types of data you just pass the correct key search for "Contact Form 7 Dynamic Text Extension" in the plugin section.

Not the answer you're looking for? Browse other questions tagged or ask your own question.