TheOdinProject/theodinproject — pull request #104 by AbbyJonesDev (2014-08-20 00:50:04+00:00)
Title: Email epic

Lots of room for making things cleaner/prettier, but basic functionality is ready to go - or at least ready for a code review.

* TestMailer - for testing / prototype purposes only.
* Checks to make sure that email belongs to campaign and category
* Sends email to one person using SendGrid API
* Records the sent email

* Footer - contains unsubscribe link and contact information (per the CAN SPAM act). Can be added to any email layout.
app/views/shared/_mailer_footer.html.erb

* Link in the footer leads to a generic unsubscribe page where users can unsubscribe from selected lists or all lists. (Unsubscribing from all also sets flag on that user.)

* User profile page contains a link to update email preferences. From that page, users can add or remove unsubscriptions. Unsubscribe_all flag is added or removed as appropriate.

CAUTIONARY NOTE: For the unsubscription stuff to work, there has to to be an EmailCampaignCategory with the name "All". I thought about putting this into a migration to make sure it's ready to go, but wasn't sure if that was the best way.

QUESTION: Should there be a random hash included in the unsubscribe link to make it a little harder to hack?