adding code to send email invitations