Today I’m going to talk a little technology, I’ve been working on new stuff for my wife’s new websiteand one of the things that came up on the enhancements is an opt-in system. I’m going to walk through the design that I’ve come up with and some of the sites I used toward making the enhancement a reality.
The site doesn’t have the enhacement yet, but here is the story that we’re going to follow for Joe, the typical user:
- Joe decides to opt-in to updates, specials on the site, clicks on the opt-in button.
- Joe is directed to a form where he will enter his first and last name, email address and accepts the opt-in.
- Joe’s email address is validated by format and sent an email asking to complete the process (double opt-in).
- Joe clicks the link in the email to verify opt-in and presented a success page.
- Joe receives a personalized email welcoming him to the system.
I’ve chosen to use a double opt-in system to prevent spam bots from using this site to overload innocent user email boxes. I’m also using a hash system as a verification to prevent a smart hacker from just randomly approving email addresses.
How does the hash system work. Well, I have the email address of the person signing up, so I will pass them a hash key to them in an email as part of the link. When they click the link, the hash will come back to the system and if it matches the email they signed up, they’re added to the database. If it doesn’t then we show a regret screen and don’t add them. The hash would be hard for person or computer to guess what it is for an email address preventing forced additions to our database.
I’m also partial to personalized permission marketing, so instead of just asking for an eMail address, I ask for their name, that way I can speak to them by name. As we interact with them, I can enhance the database with additional pieces of information as we grow our relationship. Okay, enough of the marketing discussion, back to technology.
My skills in Ruby on Rails development is still pretty weak and since this site was already built using php, we’re going to continue to use php for this enhancement. I also use a MVC model, so it will be easy to add new functionality.
I will first create the table I will be using to store any information that I gather, it will contain an id (for future switch to RoR), first name, last name, email address and other little bits of information that we want to gather. Easy to do in MySQL.
Then I add a new file to my site for the subscription controller. As Joe is interacting with the opt-in, he will be working through the controller and seeing what comes from the view. We create a basic form that will ask for the information that we’re gathering. After submission, we verify all the important pieces, email is the most important part right now. Once verified we send Joe the email (another easy task in php). We show a screen letting Joe know to check his email to verify his opt-in.
The email will have a link that will connect back to the subscription controller with some verifible information, at which point we add him to the database and send him another email welcoming him.
Typically, I surf the web looking for tidbits of code to use as examples of how to flow through the process, my inspiration came from this post. Stop by soon to see how the opt-in project is going, we’re still in development, then testing, then we go live.
Related posts:


Recent Comments