Add behavioral emails

Emails will be sent out when certain conditions match. They get logged
to email_logs so there's a record of the email sent and to ensure that
they only get sent once.