blaskovicz/MagicStick

Emailing Support

Closed this issue · 6 comments

Right now we don't email for anything.

At a minimum, we should email when:

  • a user is added to a season (email the user, cc season owner)
  • a user is removed from a season (email the user, cc season owner)
  • a user is added to a match (email the user, cc season owner)
  • a user is removed from a match (email the user, cc season owner)
  • a match's status is reported (email match participants, cc season owner)
  • a user's account is created or updated (email user)
  • a season has a comment added (email season members)
  • add unsub group support per email category

Eventually, once match comments are added, we can email match members.

We also may want preferences for each of these email settings, but that can be done as a separate task.

Also, we will want a way of just logging emails to stdout when RACK_ENV isn't production

SendGrid appears to be the most popular Heroku mail solution and it's free for 400 emails a day.

Their tutorial for Ruby includes three options. ActionMailer (rails), Mail, and Pony. Ruby Toolbox suggests that the first two are the most popular.

This tutorial makes it look pretty easy to get action mailer working. But the example for Mail seems even more simple. Both support a :test delivery method for development.

The real question is: do we want templates? If yes, I think ActionMail is the way to go.

I'm going to go ahead and configure the add-on to confirm it works first.

FYI @blaskovicz

I'm going to see if I can get ActionMailer going for the templates.

Using this commit, you can now send mail via:

    mail = Mailer.notification("ben.heiskell@gmail.com")  
    mail.deliver_now!                                     

We still need actual templates and variable substitution, but this should get us started. I need to read through another tutorial to figure out how to actually use ActionMailer.

@bheiskell as part of d3ec35f, I got emailing working for password reset.