<commit_before>class ContributorService < Service
  def self.invite_contributor_to_universe universe:, email:
    # First, look up whether a user already exists for this invite
    related_user = User.find_by(email: email)

    # Create the Contributor object with or without a user
    Contributor.create(
      universe: universe,
      email: email,
      user: related_user
    )

    # If the user doesn't already have a Notebook.ai account, send them an invite
    if related_user.nil?
      send_invite_email_to(inviter: universe.user, email: email, universe: universe)
    end

    # If the user does have a Notebook.ai account, send them an email letting them know they got added as a contributor
    if related_user
      send_contributor_notice_to(inviter: universe.user, email: email, universe: universe)
    end
  end

  def self.send_invite_email_to inviter:, email:, universe:
    CollaborationMailer.contributor_invitation(
      inviter: inviter,
      invite_email: email,
      universe: universe
    )
  end

  def self.send_contributor_notice_to email
    CollaborationMailer.contributor_invitation(
      inviter: inviter,
      invite_email: email,
      universe: universe
    )
  end
end<commit_msg>Include proper params on contrib notice<commit_after>class ContributorService < Service
  def self.invite_contributor_to_universe universe:, email:
    # First, look up whether a user already exists for this invite
    related_user = User.find_by(email: email)

    # Create the Contributor object with or without a user
    Contributor.create(
      universe: universe,
      email: email,
      user: related_user
    )

    # If the user doesn't already have a Notebook.ai account, send them an invite
    if related_user.nil?
      send_invite_email_to(inviter: universe.user, email: email, universe: universe)
    end

    # If the user does have a Notebook.ai account, send them an email letting them know they got added as a contributor
    if related_user
      send_contributor_notice_to(inviter: universe.user, email: email, universe: universe)
    end
  end

  def self.send_invite_email_to inviter:, email:, universe:
    CollaborationMailer.contributor_invitation(
      inviter: inviter,
      invite_email: email,
      universe: universe
    )
  end

  def self.send_contributor_notice_to inviter:, email:, universe:
    CollaborationMailer.contributor_invitation(
      inviter: inviter,
      invite_email: email,
      universe: universe
    )
  end
end
{'fraction_non_alphanumeric': 0.059695512820512824, 'fraction_numerical': 0.0, 'mean_word_length': 3.4273049645390072, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4114802', 'n_tokens_mistral': 741, 'n_tokens_neox': 727, 'n_words': 236}