Updates the email templates and fixes the function def