Validate a form data by sending email to the user

nunoleite

New Member
How can i make a form that sends an email with the data inserted and then a link so the user can confirm that he is the real user that filled the form?

I have already created the form and defined the send email on submit button.

i have created a field that generates a random number like a token and then in the email i'm sending this link:
<a href="https://xxx.website.com/formulario/?formulario___token={formulario___token}&formulario___validado=1&formulario___id={formulario___id}">Confirmo a minha subscrição</a>
The generated link it would be:
<a href="https://xxx.website.com/formulario/...378&formulario___validado=1&formulario___id=1">Confirmo a minha subscrição</a>

So i would like that the user receiving this email after clicking in this link it should open the form and searching for the token it should insert the value "1" in the field formulario___validado.
I need to validate if the token exists and edit the record that has this token and insert the "1" in the filed formulario___validado

But i don't know how to do this. How do i do this?

Or... Is there any other way? Is there an option to do this out of the box that i'm missing?

So what i want to do is to validate the data inserted in the form by a link sent to the user.

Thanks
 
I have done similar thing in separate PHP-file.

Link to send to customer would be something like: www.domainm.com/confirm.php?token={formulario___token}

Steps needed:
1) Create a php-file (e.g. confirm.php in joomla root).
2) Add code to load Joomla framework in the top of the file.
3) Get "token" value from the url with "$_GET";
4) Get the id of the database row where the token matches the token retrieved with GET;
5) If there is a match, update "validated" field to "1";
6) If no match, display error message like "Token not found...".
 
I am not a fan of adding php files to the joomla root. Everything should go through index.php so Joomla is properly initialized and such so if @johnonorvic solution works it would be my preference.
 
Hi!

Thanks for your reply's. I thought Fabrik could have a simpler solution for this.

I don't like to add files to Joomla too, but if that's the way to go, that's it.

I don't need the registration on Joomla i think it would complicate this.

I thought of doing something else...
I'd have 2 forms exactly the same. When a user fills one form it would receive an email with a copy of the form and a link to confirm that.
The link would have in the url all the options he answered before and it would open a new form with all the fields already filled and not editable.
Then he just needs to press the button "Confirm" and this data is saved in the new form.
So this new form are all the users that validated their data.

What do you think about this approach?

Thanks
 
This approach should work. You just need to add the token to the form url you send to the user and then in your form you can have a php-plugin which checks if the token exists. If yes, submit the form. If not, stop the form submission with error message.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top