Notifications

# Overview

This will resolve #25 which is email notifications for participants/organizers, as well as the ability for organizers to message all participants in a competition at once.


# Todo

## Tests

**Email notifications**

- [x] Participant notified on accepted into competition
- [x] Non logged in user not sent email
- [x] Participant who opts out of “participation accepted” notifications doesn’t receive those emails
- [x] Participant who opt out of “receiving mail from competition organizers” don’t receive those emails
- [x] Participant notified on permission revoked
- [x] Organizer notified on participant joining competition
- [x] Organizer who opts out of receiving “participant signed up” notifications doesn’t receive those emails

**Sending mail to participants**
- [x] View returns 200 and no data for for valid POST data
- [x] View returns 200 for GET request
- [x] View returns 400 with descriptive errors when bad
- [x] View returns 400 when no data is given
- [x] View returns 403 when not owner of competition
- [x] View returns 404 when competition doesn't exist
- [x] View returns 302 for non logged in user
- [x] Task called with proper args
- [x] Email stripped of HTML tags!
- [x] Send mass email works
- [x] Form sends AJAX request
- [x] Form display success
- [x] Form displays error

**Account email notifications updating**

- [x] View returns 200 and no data for for valid POST data
- [x] View returns 200 for GET request
- [x] View returns 400 with descriptive errors when bad
- [x] View returns 400 when no data is given
- [x] View returns 302 for non logged in user


## Templates

**Emails**
- [x] participation_accepted.html
- [x] participation_revoked.html
- [x] participation_requested.html
- [x] participation_organizer_direct_email.html
- [x] organizer_participation_requested.html
- [x] organizer_participation_revoked.html

**Account management**
- [x] settings.html

**Email participants form**
- [x] updated participants.html with modal

## Final touches

- [x] Privacy policy linked
- [x] Adheres to [CAN-SPAM](http://www.business.ftc.gov/documents/bus61-can-spam-act-compliance-guide-business)
- [x] **MERGED MASTER AND FIX MIGRATIONS!**
- [x] USE DEFAULT FROM EMAIL, from settings!!
- [x] Text and HTML versions
- [x] Organizer templates refactored

## Fixes

- [x] Fix broken URLs missing {{ site.domain }}
- [x] Add test for broken urls direct msg to participants
- [x] Add test for broken urls participation status