andypike/lagtv — pull request #249 by khall (2012-12-21 01:16:24+00:00)
Title: Fix for Issue 229 - Adds ability for admins to send email to various groups of people

Fixes: https://github.com/andypike/lagtv/issues/229

Generally this just adds admin email functionality.

Specifically this adds role selectable email functionality for admins. Currently emails are text only, we should probably allow for some standard HTML layout. The emails are sent 50 at a time via the delayed_job gem, which checks for new emails every 5 seconds. Emails have basic statistical information saved with them (how many recipients, how many emails have been sent thus far, when did the emails start getting processed).

I added a lot of rspec tests, but I haven't actually verified that the emails get sent. From my past experience with emails I seem to recall that one needs to do some anti-spam voodoo to get major ISPs to not outright filter them before they reach an inbox. This will have to happen on the test server.

Additionally to get delayed_job to run one needs to start the process (see "Running Jobs" https://github.com/collectiveidea/delayed_job). Supposedly the production way to do this is to run "RAILS_ENV=production script/delayed_job start" from RAILS_ROOT.