• Resolved backstreetprod

    (@backstreetprod)


    Hello everyone.

    I am with an issue, I would do two tasks by sending an email through “Contact Form 7”

    1. The first would save the email address of the user who contacted within a xml or txt file inside the server. One file for all users. Addresses are separated by commas or are added on a new line.

    2. I would like once sent the message, the form disappears and appears a message of thanks there, loading codes segumiento of Google, Facebook and others.

    Is it possible to do that?

    Thank You!
    ?No es correcto?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter backstreetprod

    (@backstreetprod)

    Well I Found the way to do the first point:

    in /includes/functions.php I add this:

    add_action( 'wpcf7_before_send_mail', 'correo_usuarios' );
    
    function correo_usuarios($cf7) {
       $exportar = "";
       $exportar .= "\n" . $_POST['your-email'] ;
    
     file_put_contents("/infor/cf7.txt", $exportar, FILE_APPEND);
    }

    I have to make the infor root, and every time I get an email the sender′s address records in the file.

    The secont point will have it soon.

    Thread Starter backstreetprod

    (@backstreetprod)

    well mission acomplished:

    To get a personal message after email sent I did:

    in the contact page add the next DIV ID after shortcode:

    <div id="thankYou" style="display: block;"> THANX </div>

    in the CCS sheet add:

    .wpcf7-form.sent
    {
        display:none;
    }
    
    #thankYou
    {
        font-size: 18px;
        display: none;
    }

    and in the additional confing of Contact Form:

    on_sent_ok: "$('#thankYou').show()"

    all that works for me: can u check in https://www.backstreetprod.com

    Regards!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Contact Form 7 – add a fuction’ is closed to new replies.