Added functionality to the send email button

send to email function now makes calls to api