Contact Form 7
[resolved] Contact Form for each author?? (7 posts)

  1. TC.K
    Posted 3 years ago #

    I have a multi author blog site. Instead the reader contact the author through the site-wide contact form, I want each author has their own contact form so the reader can easily reach them.

    Can CF7 do this?



  2. shoegazergirl
    Posted 3 years ago #

    I have the same question, thank you.

  3. Takayuki Miyoshi
    Plugin Author

    Posted 3 years ago #

    Special Mail Tags

    You can use [_post_author] and [_post_author_email] for such cases.

  4. TC.K
    Posted 3 years ago #

    How about i want to implement the contact form in each of the author page (author.php)? Seem the contact form doesn't allow [_post_author_email] tag. Is there anyway to do so?

  5. TC.K
    Posted 3 years ago #

    I got this problem solved by referring to this page.

  6. schwarzgrau
    Posted 3 years ago #

    [_post_author_email] needs to be inside the loop. So doesn't work on a author.php page it seems. And the solution ron_dev posted got the problem, that the email-adress got written in the html-source-code. By the way if you use Contact Form 7 - Dynamic Text Extension you got this problem too.
    It would be nice to got another special mail tag for this purposes.
    I tried it with

    $curauth = get_userdatabylogin($author_name);
    elseif ( '_author_email' == $name )
    $output = $curauth->user_email;


    $curauth = get_userdata(intval($author));
    elseif ( '_author_email' == $name )
    $output = $curauth->user_email;

    inside of special-mail-tags.php but with no luck.

    It seems the only possibility without changing the code of CF7 is to use [_post_author_email] and create an empty loop on author.php and paste CF inside. But the author needs posts for that and it feels wrong.

    $autor = $curauth->user_nicename;
    $args = array(
    		'posts_per_page' => 1,
    		'author_name' => $autor
    while ( have_posts() ) : the_post();
    echo do_shortcode( '[contact-form-7 id="442" title="my_form"]' );

    Oh yeah, It feels so dirty...

  7. schwarzgrau
    Posted 3 years ago #

    Would be nice to know how or when CF7 gets it's variables, cause I can't access the GET variables or the other variables on my author.php inside of special-mail-tags.php

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic