Fixed #195. Refactored into send_email.