Support » Plugin: Contact Form 7 Dynamic Text Extension » Using special mail tags in dynamichidden mail field

  • Resolved cybokron

    (@cybokron)


    Hello,

    I have a question. I need to use contact form 7 special mail tags. Because I m using Google sheet addon. So ı need this solution. Example special mail tag

    [_date]

    Or

    [_time]

    Please answer me.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I found solution.

    Date, time and remote ip field.

    Add function.php

    /* IP Get Start */
    function get_the_user_ip() {
    if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
    //check ip from share internet
    $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
    //to check ip is pass from proxy
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
    $ip = $_SERVER['REMOTE_ADDR'];
    }
    return apply_filters( 'wpb_get_ip', $ip );
    }
     
    add_shortcode('show_ip', 'get_the_user_ip');
    /* IP GET Finish */
    /* Date GET Start */
    
    function displaydate(){
    return date('d.m.Y');
    }
    add_shortcode('date', 'displaydate');
    /* Date GET Finish */
    /* Time GET Start */
    
    function displaytime(){
    return date('H:i');
    }
    add_shortcode('time', 'displaytime');
    /* Time Get Finish */

    Dynamic Field Shortcode in Contact Form 7 example:

    [dynamichidden date1 “date”]
    [dynamichidden time1 “time”]
    [dynamichidden ip “show_ip”]

    I m searching user-agent function.

    Plugin Author sevenspark

    (@sevenspark)

    Glad to hear you found a solution, though I don’t think you need the DTX to use CF7’s special mail tags?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using special mail tags in dynamichidden mail field’ is closed to new replies.