I have a contact form with Email, Message, Name fields.When user filled this info he/she received like autentification email with link to go and confirm.in this period info shouldnt be filled in Database.When user go with this link then info should be filled in Db with ajax php mail.
我有一个有电子邮件,信息,姓名字段的联系表。当用户填写此信息时,他/她会收到类似autentification的电子邮件,并有链接去确认。在这段时间,信息不应该在数据库中填写。当用户使用这个链接时,信息应该用ajax php邮件填充。
My question is how can track this click and when this link is clicked make an ajax request to fill info to Db and send an email with the Details.Am using wordpress, for mail using php mail function.
我的问题是如何跟踪这个点击,当这个链接被点击时,发出一个ajax请求来向Db填充信息并发送一个包含详细信息的电子邮件。我使用wordpress,使用php邮件功能。
1 个解决方案
#1
3
1) When you're creating the mail, generate an unique identifier and record it in your database in association with your user.
1)在创建邮件时,生成唯一标识符并将其与用户关联地记录在数据库中。
2) Insert this unique identifier into your link as a parameter.
2)将此唯一标识符作为参数插入到链接中。
3) When the user clicks on that link in the mail he/she received, he/she'll arrive on a page of your website/application, where a JS script of your own will read the identifier from the parameter in the URL by which the user arrived, and send it via ajax to your backend.
3)当用户点击该链接的邮件他/她,他/她会到达你的网站/应用程序的页面上,在自己的JS脚本将读取URL中的参数的标识符的用户到达,并发送你的后端通过ajax。
4) On your backend, you'll just have now to register the visit for this identifier, each time you receive a call from the ajax script.
4)在后台,您现在只需为这个标识符注册访问,每次您收到来自ajax脚本的调用。
Personnaly I'll use directly the backend without any ajax call to register the visit at the moment the user load the page.
在用户加载页面时,我将直接使用后端而不需要任何ajax调用来注册访问。
#1
3
1) When you're creating the mail, generate an unique identifier and record it in your database in association with your user.
1)在创建邮件时,生成唯一标识符并将其与用户关联地记录在数据库中。
2) Insert this unique identifier into your link as a parameter.
2)将此唯一标识符作为参数插入到链接中。
3) When the user clicks on that link in the mail he/she received, he/she'll arrive on a page of your website/application, where a JS script of your own will read the identifier from the parameter in the URL by which the user arrived, and send it via ajax to your backend.
3)当用户点击该链接的邮件他/她,他/她会到达你的网站/应用程序的页面上,在自己的JS脚本将读取URL中的参数的标识符的用户到达,并发送你的后端通过ajax。
4) On your backend, you'll just have now to register the visit for this identifier, each time you receive a call from the ajax script.
4)在后台,您现在只需为这个标识符注册访问,每次您收到来自ajax脚本的调用。
Personnaly I'll use directly the backend without any ajax call to register the visit at the moment the user load the page.
在用户加载页面时,我将直接使用后端而不需要任何ajax调用来注册访问。