TheOdinProject/theodinproject — pull request #75 by AbbyJonesDev (2014-05-04 21:24:57+00:00)
Title: Email confirmation

Pivotal Tracker ID: https://www.pivotaltracker.com/story/show/69641194

New users receive receive a confirmation token in the welcome email, and step one asks them to confirm. They have a 2-day grace period before they have to confirm.

Existing users have continued access to the site, but they are prompted to confirm their email each time they login. The flash message includes a link they can click on to receive an email with a confirmation token. When they click it, the email is sent, and they are back on the courses page. After they confirm, the flash messages stop.

I customized the confirmation email to make it a little less generic - but more tweaking might not hurt. The flash messages might need a little more style, too. I just added the "alert" class to them.

I also adjusted the welcome email, so it would be good to have a second pair of eyes proofread it.

One concern - when I click the link to confirm in the emails, I get an error that the token is invalid. This happens in both the original Devise confirmation email and the custom emails. The tokens match each other and also match the information in the database, so this seems like a test-environment issue rather than an actual problem.

Another concern - I'm not sure how this will impact people who register via Github. I'm assuming Devise has this covered, but...?

The commit messages are a little strange... I generated three separate migrations the first time around when everything should have been handled in one. I also missed the fact that I had to use "up" and "down" rather than "change" when I added confirmable. I created a new branch, reset the database, and created one migration that would do everything it was supposed to in one pass. Then I merged the rest of my commits from the first branch one at a time, replicating the messages so the history would still be there.