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
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
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;
}
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
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
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).
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?
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.