def METHOD_NAME(client, edge, invitation):
    domain = client.get_group(invitation.domain)
    short_phrase = domain.content['subtitle']['value']
    recruitment_invitation_id = invitation.content['recruitment_invitation_id']['value']
    committee_invited_id = invitation.content['committee_invited_id']['value']
    invite_label = invitation.content['invite_label']['value']
    invited_label = invitation.content['invited_label']['value']
    hash_seed = invitation.content['hash_seed']['value']
    assignment_invitation_id = invitation.content['assignment_invitation_id']['value']
    paper_reviewer_invited_id = invitation.content['paper_reviewer_invited_id']['value']
    email_template = invitation.content['email_template']['value']
    is_reviewer = 'Reviewers' in assignment_invitation_id
    action_string = 'to review' if is_reviewer else 'to serve as area chair for'
    print(edge.id)
    if edge.ddate is None and edge.label == invite_label:
        ## Get the submission
        notes=client.get_notes(id=edge.head)
        if not notes:
            raise openreview.OpenReviewException(f'Note not found: {edge.head}')
        submission=notes[0]
        ## - Get profile
        user = edge.tail
        print(f'Get profile for {user}')
        user_profile=openreview.tools.get_profile(client, user)
        inviter_id=openreview.tools.pretty_id(edge.signatures[0])
        inviter_profile=openreview.tools.get_profile(client, edge.tauthor)
        inviter_preferred_name=inviter_profile.get_preferred_name(pretty=True) if inviter_profile else edge.signatures[0]
        if not user_profile:
            user_profile=openreview.Profile(id=user,
                content={
                    'names': [],
                    'emails': [user],
                    'preferredEmail': user
                })
        preferred_name=user_profile.get_preferred_name(pretty=True)
        ## - Build invitation link
        print(f'Send invitation to {user_profile.id}')
        from Crypto.Hash import HMAC, SHA256
        hashkey = HMAC.new(hash_seed.encode('utf-8'), msg=user_profile.id.encode('utf-8'), digestmod=SHA256).hexdigest()
        baseurl = 'https://openreview.net' #Always pointing to the live site so we don't send more invitations with localhost
        # build the URL to send in the message
        invitation_url = f'{baseurl}/invitation?id={recruitment_invitation_id}&user={user_profile.id}&key={hashkey}&submission_id={submission.id}&inviter={edge.tauthor}'
        invitation_links = f'''Please respond the invitation clicking the following link: