Switch to using templates for email notifications

Hi Zsolt,

With this pull request we can switch over to using template files for email notifications. The function "send_email" requires the name of the template, and an object with the following fields:
Mandatory:
- recipient_email {REC_EMAIL}

Optional:
- recipient_name {REC_NAME}
- sender_name {SEN_NAME}
- sender_email {SEN_EMAIL}
- auth (code) {AUTHCODE}
- proj_name {PROJ_NAME}
- content {CONTENT}
- subject (though if this is missing, the subject will be "no subject")

The function will then replace the above values (in curly brackets) in the .tpl files and send the email. If I'm not passing something for it that should be replaced, then it will simply remove the placeholder.

Also replaced the two places where we're sending emails to use the updated logic instead.

Cheers