简体   繁体   English

发送Javascript变量(Cookie)作为联系表格7

[英]Send javascript variables (cookies) as Contact Form 7

I'm building a javascript configurator for choosing the color and other aspects of a car, and I store the data in cookies that are later shown to the user in a table with the pricing of each feature, how can I send these cookies as an email? 我正在构建用于选择汽车颜色和其他方面的javascript配置程序,并将数据存储在cookie中,然后将这些数据显示在表格中,并以每个功能的价格显示给用户,如何将这些cookie作为电子邮件?

I have a solution in mind, im using wordpress, and I have contact form 7 plugin, if I could make a script to auto-fill the message field with javascript variables that would output the cookies to this hidden field, I could then send it to a chosen email using the plugin, my doubt is, I have no clue about how to do this, thats why im asking for your help, perhaps someone has been around for longer and has tried to fiddle with this plugin. 我有一个解决方案,我使用的是wordpress,并且我有联系表格7插件,如果我可以编写一个脚本来使用JavaScript变量自动填充消息字段,该变量会将Cookie输出到此隐藏字段,那么我可以将其发送到使用该插件选择的电子邮件,我的疑问是,我对如何执行此操作一无所知,这就是为什么即时消息寻求您的帮助,也许有人已经待了更长时间并且试图摆弄这个插件。

You can use https://github.com/carhartl/jquery-cookie . 您可以使用https://github.com/carhartl/jquery-cookie

Get the cookie value by $.cookie("example") and pass it to hidden field: 通过$.cookie("example")获取cookie值,并将其传递给隐藏字段:

$('#hiddenFieldID').val($.cookie("example"));

You can set hidden field in the ContactForm7 admin area. 您可以在ContactForm7管理区域中设置隐藏字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM