<commit_before>class AlertsMailer < ActionMailer::Base
  default :from => '<EMAIL>'

  def projects_about_to_end(contact_email, projects)
    @projects = projects
    mail(:to => contact_email, :subject => "[NGO Aid Map] Projects about to end!")
  end

  def reset_password(user_email, reset_token)
    @reset_token = reset_token
    mail(:to => user_email, :subject => "Change your NGO Aid Map password")
  end

  def six_months_since_last_login(user)
    mail(:to => user.email, :subject => "NGO Aid Map - We Miss You!")
  end

  if Rails.env.development?
    class Preview < MailView

      def projects_about_to_end
        contact_email = '<EMAIL>'
        projects = Project.first(6).map do |project|
          {
            :id           => project.id,
            :name         => project.name,
            :country_name => project.countries.map(&:name).join(', ').presence || 'Spain',
            :end_date     => project.end_date.to_date
          }
        end
        ::AlertsMailer.projects_about_to_end(contact_email, projects)<commit_msg>Adds cc to six_months_since_last_login alert<commit_after>class AlertsMailer < ActionMailer::Base
  default :from => '<EMAIL>'

  def projects_about_to_end(contact_email, projects)
    @projects = projects
    mail(:to => contact_email, :subject => "[NGO Aid Map] Projects about to end!")
  end

  def reset_password(user_email, reset_token)
    @reset_token = reset_token
    mail(:to => user_email, :subject => "Change your NGO Aid Map password")
  end

  def six_months_since_last_login(user)
    mail(:to => user.email, :cc => '<EMAIL>', :subject => "NGO Aid Map - We Miss You!")
  end

  if Rails.env.development?
    class Preview < MailView

      def projects_about_to_end
        contact_email = '<EMAIL>'
        projects = Project.first(6).map do |project|
          {
            :id           => project.id,
            :name         => project.name,
            :country_name => project.countries.map(&:name).join(', ').presence || 'Spain',
            :end_date     => project.end_date.to_date
          }
        end
        ::AlertsMailer.projects_about_to_end(contact_email, projects)
{'fraction_non_alphanumeric': 0.11879350348027842, 'fraction_numerical': 0.0009280742459396752, 'mean_word_length': 2.7560975609756095, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 31, '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': '3074040', 'n_tokens_mistral': 688, 'n_tokens_neox': 658, 'n_words': 155}