code: def send_invitation(self, user, sender=None, **kwargs):
          
          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
docs: 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.