Any thoughts/recommendation on scripts or documentation on implementing a email account activation after a user creates an account. Anything BESIDES the developer toolkit?
Thanks,
Mike
<cfset activateKey = CreateUUID()>
Create a column in the user database table to store the key. Create an
additional boolean column for activated.
Save the key as part of saving the user email information and default the
activated to false.
Then just send an email and build an href back to an activation template.
<cfmail to="some...@somesite.com" from="activa...@somesite.com"
type="HTML">
Please click the link to activate your email
<a href="http://somesite.com/activate.cfm?activateKey=#activateKey#>
</cfmail>
You should also consider using <cfmailpart> for supplying a text only
activation section for those users that have mail readers that don't support
HTML, as well as instructions for copying and pasting the url into a browser.
In systems I've implemented in the past, I like to store the date of
activation for retiring old emails or sending out reminder notices such as
<cfquery datasource="someDSN">
update users
set activate = 1,
active_date = <cfqueryparam cfsqltype="cf_sql_date" value="#now()#">
where activateKey = <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="35"
value="#url.activateKey#">
and activate = 0
</cfquery>