Update invite.php

$group = get_entity($group_guid); <-- we only need to do this once, instead of doing it inside the foreach loop.