implemented logic for email and sms forms