<commit_before>class Notifications::NewWallComment < Notification
  TRIGGER_KEY = 'user.comment'
  DEFAULT_INTERVAL = :daily
  BITMASK = 2**10

  def self.receivers(activity)
    User.where(id: activity.trackable.id)
  end

  def self.condition(activity)
    activity.owner.present? && activity.recipient.present?
  end

  def self.description
    'Jemand hat auf meine Pinnwand geschrieben'
  end

  def custom_mail_vars
    {
      comment_url: graetzl_user_url(activity.trackable.graetzl, activity.trackable, DEFAULT_URL_OPTIONS) + "#comment-#{activity.recipient.id}",
      comment_content: activity.recipient.content.truncate(300, separator: ' '),
      owner_name: activity.owner.username,
      owner_url: user_url(activity.owner, DEFAULT_URL_OPTIONS),
      owner_avatar_url: Notifications::ImageService.new.avatar_url(activity.owner)
    }
  end

  def mail_subject
    'Neuer Beitrag an deiner Pinnwand'
  end
end
<commit_msg>prepared for new immediate mail<commit_after>class Notifications::NewWallComment < Notification
  TRIGGER_KEY = 'user.comment'
  DEFAULT_INTERVAL = :daily
  BITMASK = 2**10

  def self.receivers(activity)
    User.where(id: activity.trackable.id)
  end

  def self.condition(activity)
    activity.owner.present? && activity.recipient.present?
  end

  def self.description
    'Jemand hat auf meine Pinnwand geschrieben'
  end

  def custom_mail_vars
    {
      name: 'Neuer Eintrag auf deiner Pinnwand:',
      comment_url: graetzl_user_url(activity.trackable.graetzl, activity.trackable, DEFAULT_URL_OPTIONS) + "#comment-#{activity.recipient.id}",
      comment_content: activity.recipient.content.truncate(300, separator: ' '),
      owner_name: activity.owner.username,
      owner_url: user_url(activity.owner, DEFAULT_URL_OPTIONS),
      owner_avatar_url: Notifications::ImageService.new.avatar_url(activity.owner)
    }
  end

  def mail_subject
    "#{activity.owner.username} hat auf deine Pinnwand geschrieben."
  end
end

{'fraction_non_alphanumeric': 0.09695431472081219, 'fraction_numerical': 0.006091370558375634, 'mean_word_length': 4.2841823056300266, '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': '4253885', 'n_tokens_mistral': 664, 'n_tokens_neox': 648, 'n_words': 121}