updated send invitation function to include messaging