updated code to handle the new tick method of sending an email or not from controllers