Forums

email confirmation?

Cronie 07 Aug, 2014
Hello🙂

Is there any way to confirm a person's email through chronoforms? I mean, I would like a form where the person enters their email and then they are sent an email to confirm that the address is correct. Once they confirm their email, they would be able to complete the form, or would be sent to another form.

Just need some way of automatically confirming email addresses.

Love chronoforms, keep up the nice work🙂

Thanks
Cronie 08 Aug, 2014
OK, I found a tutorial on what I think I need http://www.chronoengine.com/faqs/61-cfv4/cfv4-tutorials/2551-how-can-i-verify-an-email-address.html

But I am getting stuck on adding the "Email verification sender" I don't see this anywhere on the list of setup actions. I am using version 5 and the tutorial is for version 4, I think. Is it called something different?

Help would be most appreciated🙂
GreyHead 09 Aug, 2014
Hi Cronie,

I don't think that Email Verification actions yet exist for CFv5. Maybe in a future release.

I would do it by generating a unique string to identify the transaction, save that plus the other form info to a database table with a status column set to 'unconfirmed'. Create a new event in your form, add a link to the email to that event including the id string e.g.
http://my_domain.com/index.php?option=com_chronoforms5&chronoform=form_name&event=verify&id=xxxx

In the event add a Custom Code action to check the database table to see if the string is valid, then update the status if it is.

Bob
Cronie 10 Aug, 2014
Thank you for your response,

Unfortunately, I don't know php coding so i wouldn't be able to do what you suggested, I don't think. I don't suppose you know when this might be updated in a CF 5?

Or do you think if I downgraded to CF 4 I would still be able to use my existing forms?

Thanks again
GreyHead 10 Aug, 2014
Hi Cronie,

If you created your form in CFv5 then I'm afraid that there is no easy route to transfer them to CFv4.

This doesn't need much (or any) PHP. Mostly it can be done with standard ChronoForms actions. Take it step by step and it shouldn't be too difficult.

Bob
Cronie 10 Aug, 2014
Is there a reference manual for CF 5? A link that describes all the actions and events?

I have found a lot of tutorials on youtube and such, but this procedure seems more advanced than those.

TY
Cronie 13 Aug, 2014

Hi Cronie,
I would do it by generating a unique string to identify the transaction, save that plus the other form info to a database table with a status column set to 'unconfirmed'. Create a new event in your form, add a link to the email to that event including the id string e.g.

http://my_domain.com/index.php?option=com_chronoforms5&chronoform=form_name&event=verify&id=xxxx

In the event add a Custom Code action to check the database table to see if the string is valid, then update the status if it is.


I have done some work on this and have some pieces working, but I am a novice and i am having some trouble.

I have added a save to database function that appears to be working. When I created a table, it automatically made fields called "id," "uniq_id" and "user_id" Should I use one or more of those and where?

How can I get the link to display properly in the email? When I tried
http://my_domain.com/index.php?option=com_chronoforms5&chronoform=form_name&event=verify&id={id}

it wouldn't display the {id} value in the email. I am assuming it is in the wrong format?

I created an event called "verify" and it appears to go off when I go to the above link (for instance it will display a message) but I would like it to do a database read and check that the person has not been verified, then set the "verified" value to 1 and send an email to the person. How do I change the value from 0 to 1 in the database? Can I make it so this only happens when a specific user or IP address has clicked the link?

Thank you for any help you can provide🙂
Max_admin 13 Aug, 2014
Please test using a "debugger" action to check how your data is formatted, the "id" field should exist in the data array!

I don't suggest using the "id" field since its sequential, the "uniq_id" should do it, but unfortunately the latest public release doesn't have this field auto populated, the next one does though, but for now, just use the id and you can change it later easily.

Now in the "verify" event, just add a "db read" and use this in the "conditions" box:

<?php
return array("id" => $form->data("id"), "verified" => 0);

Your table must have a field named "verified", set its type to "TINYINT" with length = 1
Set the "read under model id" in the "db read" to "yes"
and in the "record found" event, add a"custom code" action then a "db save" action.
In the "custom code":

<?php
$form->data["model"]["verified"] = 1;

and in the "db save", set the "save under model id" to "yes" and now it should update the record and set the "verified" field to 1

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Cronie 13 Aug, 2014

...
Now in the "verify" event, just add a "db read" and use this in the "conditions" box:


<?php
return array("id" => $form->data("id"), "verified" => 0);

Your table must have a field named "verified", set its type to "TINYINT" with length = 1
Set the "read under model id" in the "db read" to "yes"
and in the "record found" event, add a"custom code" action then a "db save" action.
In the "custom code":

<?php
$form->data["model"]["verified"] = 1;

and in the "db save", set the "save under model id" to "yes" and now it should update the record and set the "verified" field to 1

Max



Thank you for the reply.

I am getting some errors with this still though, I am sure it is my inexperience.

1. I can't get the link to send correctly in the email. When I use {id} in the text, it just gets deleted.
[attachment=0]link.JPG[/attachment]
Do I have this formatted correctly?
http://mysite.com/index.php?option=com_chronoforms5&chronoform=joinform&event=verify&id={id}

2. When I set "Enable model ID" to yes, the data is not getting saved to the database. Here is a screenshot of my mysql. The first line was with model id set to "no." The others are with it set to "yes."
[attachment=1]mysql.JPG[/attachment]

If I enter the above link and type in an id manually, I get this error
[attachment=2]error.JPG[/attachment]
but I don't know how to decipher it.

I am also including a couple other screenshots that I hope may be useful.

This is the layout I have for the form, I have tried placing the data save in either the "on submit" section or the "on verify" or both. Same results.
[attachment=3]layout.JPG[/attachment]

An example debug screen of the initial "on submit"
[attachment=4]debug.JPG[/attachment]

Thank you guys again for being so helpful with this🙂
Cronie 13 Aug, 2014
Sorry, but I uploaded the wrong screenshot for the model id examples and I don't see away to edit posts. Here is the shot.
[attachment=0]model id on and off.JPG[/attachment]
Max_admin 24 Aug, 2014
Answer
Sorry for the delay here!

You don't have a "verified" column in your table, the Email must be after the "Db save" in order to capture the id value!

You can test the link..etc using a "display message" action instead of sending emails, the strings are replaced the same way.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Cronie 25 Aug, 2014

Sorry for the delay here!

You don't have a "verified" column in your table, the Email must be after the "Db save" in order to capture the id value!

You can test the link..etc using a "display message" action instead of sending emails, the strings are replaced the same way.

Regards,
Max



OK, this appears to be functional now.

I couldn't get it to work with "Model ID" set to yes ... I have to have this set to no. I don't know what the difference is, but it works.

Thanks very much to both of you for your help.🙂
Max_admin 25 Aug, 2014
You can keep the model id set to no in both db read and db save, but using the model id makes things more tidy!🙂
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.