<commit_before># Mailer for issues
class IssueMailer < ActionMailer::Base
  default :from => "'Tyne' <<EMAIL>>"

  # Sends a notification to all contributors
  # that a new issue has been raised.
  def self.send_issue_raised(issue_id)
    issue = Issue.find_by_id(issue_id)
    issue.project.workers.each do |worker|
      delay.issue_raised(issue_id, worker.id)
    end
  end

  # Sends a notification that a new issue has been raised.
  def issue_raised(issue_id, worker_id)
    @issue = Issue.find_by_id(issue_id)
    @worker = TeamMember.find_by_id(worker_id)
    to = @worker.user.notification_email

    mail(:to => to, :subject => "[Raised] #{@issue.key} - #{@issue.summary}") if to
  end

  # Sends a notification to the reporter of the issue
  # that the issue has been closed.
  def issue_closed(issue_id)
    @issue = Issue.find_by_id(issue_id)

    # Send to reporter
    if @issue.reported_by
      to = @issue.reported_by.notification_email
      mail(:to => to, :subject => "[Closed] #{@issue.key} - #{@issue.summary}") if to
    end
  end

  # Sends a notification to the assignee
  # that the issue has been reopened.
  def issue_reopened(issue_id)
    @issue = Issue.find_by_id(issue_id)
    # Send to to assignee
    if @issue.assigned_to
      to = @issue.assigned_to.notification_email
      mail(:to => to, :subject => "[Reopened] #{@issue.key} - #{@issue.summary}") if to
    end
  end
end<commit_msg>do not email the person who raised the issue<commit_after># Mailer for issues
class IssueMailer < ActionMailer::Base
  default :from => "'Tyne' <<EMAIL>>"

  # Sends a notification to all contributors
  # that a new issue has been raised.
  def self.send_issue_raised(issue_id)
    issue = Issue.find_by_id(issue_id)
    issue.project.workers.each do |worker|
      delay.issue_raised(issue_id, worker.id) unless is_reporter?(worker, issue)
    end
  end

  # Sends a notification that a new issue has been raised.
  def issue_raised(issue_id, worker_id)
    @issue = Issue.find_by_id(issue_id)
    @worker = TeamMember.find_by_id(worker_id)
    to = @worker.user.notification_email

    mail(:to => to, :subject => "[Raised] #{@issue.key} - #{@issue.summary}") if to
  end

  # Sends a notification to the reporter of the issue
  # that the issue has been closed.
  def issue_closed(issue_id)
    @issue = Issue.find_by_id(issue_id)

    # Send to reporter
    if @issue.reported_by
      to = @issue.reported_by.notification_email
      mail(:to => to, :subject => "[Closed] #{@issue.key} - #{@issue.summary}") if to
    end
  end

  # Sends a notification to the assignee
  # that the issue has been reopened.
  def issue_reopened(issue_id)
    @issue = Issue.find_by_id(issue_id)
    # Send to to assignee
    if @issue.assigned_to
      to = @issue.assigned_to.notification_email
      mail(:to => to, :subject => "[Reopened] #{@issue.key} - #{@issue.summary}") if to
    end
  end

  private
  def is_reporter?(worker, issue)
    worker.user_id == issue.reported_by.id
  end
end
{'fraction_non_alphanumeric': 0.11269946808510638, 'fraction_numerical': 0.0, 'mean_word_length': 3.451183431952663, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '5688690', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1005, 'n_words': 285}