<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_invitation(self, user, sender=None, **kwargs):
 """An intermediary function for sending an invitation email that selects the templates, generating the token, and ensuring that the user has not already joined the site. """

        if user.is_active:
            return False
        token = self.get_token(user)
        kwargs.update({"token": token})
        self.email_message(
            user, self.invitation_subject, self.invitation_body, sender, **kwargs
        ).send()
        return True