<commit_before>class UserMailer < ActionMailer::Base
  include ApplicationHelper
  default :from => "\"Loomio\" <<EMAIL>>"

  def daily_activity(user, activity, since_time)
    @user = user
    @activity = activity
    @since_time = since_time
    @since_time_formatted = since_time.strftime('%A, %-d %B')
    @groups = user.groups.sort{|a,b| a.full_name <=> b.full_name }
    mail to: @user.email,
         subject: "Loomio - Summary of the last 24 hours"
  end

  def mentioned(user, comment)
    @user = user
    @comment = comment
    @discussion = comment.discussion
    mail to: @user.email,
         subject: "#{comment.author.name} mentioned you in the #{comment.group.name} group on Loomio"
  end

  def group_membership_approved(user, group)
    @user = user
    @group = group
    mail( :to => user.email,
          :reply_to => @group.admin_email,
          :subject => "#{email_subject_prefix(@group.full_name)} Membership approved")
  end

  def motion_closing_soon(user, motion)
    @user = user
    @motion = motion
    mail to: user.email,
         reply_to: @motion.author,
         subject: "[Loomio - #{@motion.group.name}] Proposal closing soon: #{@motion.name}"
  end

  def added_to_group(membership)
    @user = membership.user
    @group = membership.group
    @inviter = membership.inviter
    mail( :to => @user.email,
          :reply_to => @group.admin_email,
          :subject => "[Loomio] You've been added to a group called '#{@group.full_name}'")
  end

  # Invited to loomio (assumes user has been invited to a group at the same time)
  def invited_to_loomio(new_user, inviter, group)
    @new_user = new_user
    @inviter = inviter
    @group = group
    mail( :to => new_user.email,
          :reply_to => inviter.email,
          :subject => "#{inviter.name} has invited you to #{group.full_name} on Loomio")
  end
end
<commit_msg>Fix proposal closing soon email.<commit_after>class UserMailer < ActionMailer::Base
  include ApplicationHelper
  default :from => "\"Loomio\" <<EMAIL>>"

  def daily_activity(user, activity, since_time)
    @user = user
    @activity = activity
    @since_time = since_time
    @since_time_formatted = since_time.strftime('%A, %-d %B')
    @groups = user.groups.sort{|a,b| a.full_name <=> b.full_name }
    mail to: @user.email,
         subject: "Loomio - Summary of the last 24 hours"
  end

  def mentioned(user, comment)
    @user = user
    @comment = comment
    @discussion = comment.discussion
    mail to: @user.email,
         subject: "#{comment.author.name} mentioned you in the #{comment.group.name} group on Loomio"
  end

  def group_membership_approved(user, group)
    @user = user
    @group = group
    mail( :to => user.email,
          :reply_to => @group.admin_email,
          :subject => "#{email_subject_prefix(@group.full_name)} Membership approved")
  end

  def motion_closing_soon(user, motion)
    @user = user
    @motion = motion
    mail to: user.email,
         reply_to: @motion.author.email,
         subject: "[Loomio - #{@motion.group.name}] Proposal closing soon: #{@motion.name}"
  end

  def added_to_group(membership)
    @user = membership.user
    @group = membership.group
    @inviter = membership.inviter
    mail( :to => @user.email,
          :reply_to => @group.admin_email,
          :subject => "[Loomio] You've been added to a group called '#{@group.full_name}'")
  end

  # Invited to loomio (assumes user has been invited to a group at the same time)
  def invited_to_loomio(new_user, inviter, group)
    @new_user = new_user
    @inviter = inviter
    @group = group
    mail( :to => new_user.email,
          :reply_to => inviter.email,
          :subject => "#{inviter.name} has invited you to #{group.full_name} on Loomio")
  end
end

{'fraction_non_alphanumeric': 0.12383736380547436, 'fraction_numerical': 0.0010629816635663034, 'mean_word_length': 3.051668460710441, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, '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': '7628230', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1218, 'n_words': 332}