Page 1 of 1

user email verification system

Posted: 07 Nov 2016, 17:53
by alfredlaggner
I have a store pick up delivery system. I want to avoid bogus orders from unverified users because it would create unnecessary work for getting orders ready that get never picked up.
One solution I am considering is a simple verification process where a user needs to verify they got the order verification email by clicking a link in the email. (Like when you sign up for a service on the internet).
I could not find anything like that in aimeos.
For it to function, I would have to create a random number when the user gets inserted into the user database. This random number would the be part of URL the user has to click in the 'thank you for your order' email. After clicking the link user will be set to 'verified' by setting a verified column in the user database.
After verification, the delivery status should be set to the next status (either to pending or progress I am not sure right now).
What would be the simplest way to program this in Aimeos/Laravel? Or can you think of a solution the fits better with Aimeos?

Re: user email verification system

Posted: 08 Nov 2016, 14:21
by aimeos
If you want to do it every time, you can create a hash over selected address and product data and add that link to the confirmation e-mail. After the customer clicked the link, your own action can verify the hash by hashing the same data again and set the delivery status of that order to "in progress".

Also, it may be only necessary to send a verification link once to the customer when they create the account. There's already a "verification date" column in the users/customer table:
- https://github.com/aimeos/aimeos-larave ... le.php#L36
- https://github.com/aimeos/aimeos-core/b ... e.php#L128

You can create a hash over the customer data and add it to the account creation e-mail:
https://github.com/aimeos/ai-client-htm ... efault.php
In your own action, you can then update the verification date field if the customer clicked on the link and you've verified the hash.

Re: user email verification system

Posted: 08 Dec 2016, 01:27
by alfredlaggner
I have been able to set the delivery status to "in progress" by having the customer click on a link in their confirmation email. But every time they do that the system creates an empty screen on their browser.
How can I avoid that? Is AJAX the solution? If yes, how do I put the code in 'html-intro-body-default.php"? What I want is that status change happens in the background. The change of status then triggers a confirmation email which already works.
Thank you.

Re: user email verification system

Posted: 08 Dec 2016, 15:15
by aimeos
You can't do that in the context of an e-mail. Clicking on the link will always open a browser and it will display the page returned by the web server. Your controller/action updating the status should display a page with "Thank you for your confirmation. You will be notified as soon as you can pick up your order"

Re: user email verification system

Posted: 08 Dec 2016, 23:15
by alfredlaggner
I will do just that!
Thank you!