def encode_member(member):
    """Encode a team member and return fields:
    - name
    - profileUrl (optional)
    """
    res = {
        'name': member.name,
    }
    if member.profile_url:
        res['profileUrl'] = member.profile_url
    return res