Forums

add link to email to approve record

emmexx 21 Oct, 2012
I'd like to know if CF v4 has some action to perform the following:

- guest (no login required) submits a form
- guest receives email notification
- data stored in a table
- a "moderator" receives an email notification with a link. Opening the link in a web browser "approves" the record without login. Approve the record means that a flag (a field) is set for that record.

This system is used by some application to notify and approve mailing list messages, forum comments and so on.

I checked CF actions to no avail.

Thank you
maxx
GreyHead 21 Oct, 2012
Hi Maxx,

The first three are easily done with standard ChronoForms actions.

For the fourth I think that you can use the Email Verification Sender and Email Verification Response actions. The Sender emails a link and the Response updates a database entry. The only problem you may have is that it will only update a boolean (true/false or 0/1) column. Check the Help tabs on the action for a bit more info.

If you need something more complicated updated you'd replicate these actions in Custom Code. One in the On Submit event would build a link to go in the email and save the key info in the database. One in a New Event would be activated when the link was clicked, check the key is valid and update the database table to match.

Bob
emmexx 21 Oct, 2012

For the fourth I think that you can use the Email Verification Sender and Email Verification Response actions. The Sender emails a link and the Response updates a database entry. The only problem you may have is that it will only update a boolean (true/false or 0/1) column. Check the Help tabs on the action for a bit more info.



Thank you Bob,
I had checked those actions but I didn't understand how to set the email address, I didn't read the last line of the help in Email Verification Sender. 😶

I found your mini tutorial in the forum, so I added an Email Verification Sender to the submit event of my form, followed by an email to the approver with the {verification_link} tag.

The Response is a little bit obscure to me. I understand the meaning of the action but I don't understand where should I put it.
I created a new event in my form (I named it verify) and added there an Email Verification Response action, but I'm not sure what to do now.
The verification link is in the form:
http://my.site/index.php?option=com_chronoforms&chronoform=myform&action=verify&hash=1234567890abcdef1234567890abcdef
When I click on that link my form opens empty but the verification status isn't updated.

In the Email Verification Sender action I didn't fill the Verification link path.
I supposed that verify is the default action and I could put the Response in a verify action in my form.

Should I update the field in the DB in the OnSuccess event of the Response action?
Should I create another form to manage the Response?

Thank you
maxx
GreyHead 23 Oct, 2012
Hi emmexx,

I think the URL needs to be &event=verify instead of &action=verify please see if that get's it working.

Bob
emmexx 23 Oct, 2012
[quote="GreyHead"]Hi emmexx,

I think the URL needs to be &event=verify instead of &action=verify please see if that get's it working.
[/quote]

[color=#000080]&action=verify[/color] gets checked in the file email_verification_response.php
if($_GET['action'] == 'verify'){...


Instead of replacing it I added [color=#000080]&event=verify[/color] to the link.

The link works as expected as:
http://my.site/index.php?option=com_chronoforms&chronoform=myform&action=verify&hash=1234567890abcdef1234567890abcdef&event=verify

Action=verify refers to the action used by the email verification plugin, it's coded in it.
Event=verify refers to an event that I added to my form. Any othe name can be used here instead of verify.

I'll buy you half a beer!🙂

Thank you
maxx
GreyHead 23 Oct, 2012
Hi Maxx,

Well found :-)

Bob
emmexx 24 Oct, 2012
I don't know if I should report it elsewhere but there's a small glitch in the email Verification Sender action.
If you use it in your form you won't use a DB Save action. But it won't be possible to show data in the admin panel because there's not a table to be selected in the Tables Connected column of Forms manager.

bye
maxx
GreyHead 24 Oct, 2012
Hi Maxx,

Thanks, I'll link this post into the bugs list.

Bob

PS The AceSQL extension is good for looking at database records from the site admin.
This topic is locked and no more replies can be posted.