I found this in this documentation, which is what I need:
[dynamictext dynamicname “CF7_get_current_user key=’user_email’ obfuscate=’on’”]
However, it looks like I can’t use this shortcode in the “to” field on the Mail Tab in CF7. I get an “invalid mailbox syntax” error.
Nevermind. CF7 already has a post email shortcode.
If you use a dynamictext or dynamichidden form tag to populate the “to” field in the email template, Contact Form 7 will display that validation error.
If it’s not email*, you’ll see an error because [your-email] can be empty or a non-email value. These are examples of bad form-tags:
[email your-email] // Email, but not required
[text* your-email] // Required, but not Email
[select your-email “john@example.com” “johnjr@example.com”] // Not required
Contact Form 7 Documentation
It is something I’ve been interested in looking into with a future update.
If you’re using Contact Form 7 version 7.4.4 or above, you can add this to your wp-config.php file to suppress those pesky warnings:
define('WPCF7_VALIDATE_CONFIGURATION', false);
You can learn more about CF7’s configuration validator in their FAQ documentation here.
However, since your user is a WordPress user and the form is only available to logged-in users, you can use the email form tag with built-in attributes:
[email* your-email default:user_email]
Using that, the CF7’s validator will be satisfied. Cheers!
Learn more about setting default values to the logged-in user in CF7.