WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Contact Form 7] autofill email of logged in user (2 posts)

  1. mkudro
    Member
    Posted 4 years ago #

    Hi

    Does any one knows if it is possible to do following:

    Normally when i build form i include 'email' and 'name' fields and when visitors fill them in i get there name and email as it was intended.

    But for users that are logged in i want to leave those fields out, it could be frustrating when you are logged into have to fill your name and email all over again.

    But when i leave those fields out, i do get email but no idea from whom.

    Is it possible to somehow fetch email off logged in user and put if in the form so i would know which of logged in users has sent the form?

    thnax in advance for you help

    http://wordpress.org/extend/plugins/contact-form-7/

  2. fuzzie
    Member
    Posted 3 years ago #

    I'm trying this too:

    <?php global $current_user; if ( isset($current_user) ) {
    echo $current_user->user_login;
    ?>
    [contact-form 3 "Contact Form 1 - registered users"]

    <?php } else { ?>
    [contact-form 1 "Contact form 1"]
    <?php } ?>

    Haven't figured out how to include the name and email yet, but at least it displays the name.

Topic Closed

This topic has been closed to new replies.

About this Topic