• Resolved Dan Stramer

    (@danstramer)


    Hi,
    Thank you for developing this great plugin, I can see some great uses for it!
    I’ve installed the plugin and it’s working, pulling in the fields.
    But how can I add a date field?
    When adding [_date] to the mail tab it doesn’t collect the date to zapier.
    am I doing something wrong?

    This is the email tab in cf7:
    From: [your-name] <[your-email]>
    Phone: [your-tel]
    Subject: [_post_title]
    Message Body:
    [your-message]

    [_date]

    But the Zapier tab still looks like this:
    {
    “your-name”: “??????”,
    “your-email”: “??????”,
    “your-tel”: “??????”,
    “your-message”: “??????”
    }

    Thanks
    Dan

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Mário Valney

    (@mariovalney)

    Hey @danstramer!
    Thanks for your words.

    I guess you should remove the “underline” of “_date”.
    Try create a [date your-date] tag and check the Zapier tab.

    Regards

    Thread Starter Dan Stramer

    (@danstramer)

    Thanks.
    But I just want to add a timestamp to when the lead was sent.
    Adding a [date] tag in the form will create a date UI for the users, and that is not what I want.
    I thought that adding the [_date] tag like described here:
    https://contactform7.com/special-mail-tags/
    would pass it to zapier.
    Another option – is there a way to fetch the meta data of the form?

    Dan

    Plugin Author Mário Valney

    (@mariovalney)

    Well…

    [_date] is a “(Special) Mail Tag” so it only works when CF7 is sending the mail.
    As it’s not a tag in form, “CF7 to Zapier” cannot send it.

    But you can add anything you want to data sended to CF7 using the filter ctz_get_data_from_contact_form.

    It’s in cf7-to-zapier/modules/cf7/class-module-cf7.php file in get_data_from_contact_form method.

    So you can add this to your functions.php:

    add_filter( 'ctz_get_data_from_contact_form', 'dan_add_time_to_form', 10, 2 );
    
    function dan_add_time_to_form( $data, $contact_form ) {
        $data['submited_at'] = date( 'Y-m-d H:i:s' );
    
        return $data;
    }
    Thread Starter Dan Stramer

    (@danstramer)

    Thanks very much for the info Mario,
    I ended up using Zapier’s own date stamp:
    {{zap_meta_human_now}}

    https://zapier.com/help/modifying-dates-and-times/

    Dan

    Thread Starter Dan Stramer

    (@danstramer)

    For future reference, if I’ll use the function above, where should I add the [submited_at] tag? With the other mail tags in cf7?

    Thanks
    Dan

    Plugin Author Mário Valney

    (@mariovalney)

    It’s not needed to add any tags @danstramer

    The filter ctz_get_data_from_contact_form runs before sending data to Zapier and the code is adding a pair key => value to the data array (the key is submited_at and the value is the returning of the function date( 'Y-m-d H:i:s' ) – a date in format 2018-12-31 23:59:59).

    Thread Starter Dan Stramer

    (@danstramer)

    Ok, thanks.
    And if I wanted to use a cf7 tag for date or page title etc… how can this be achieved with your plugin?

    Plugin Author Mário Valney

    (@mariovalney)

    The plugin supports any CF7 form tag used in form.
    As you can check in get_data_from_contact_form() method: we scan for form tags and add to data any POST value that corresponds.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Additional fields’ is closed to new replies.