add conditional for email sent

closes #124