We developed such a function for LabforCulture, http://www.labforculture.org. However, it requires an additional table, since we want to store a unique confirmation string as well. If you are interested, I can send you the code.
Kind regards, Sebastiaan
Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.