<commit_before>class WebformMailer < ActionMailer::Base
  
  def admin_notification(form)
    setup_recipients(form.webform)
    from               submitter_of(form)
    subject            form.webform.name
    @form_data = form.attributes
  end
  
  def response(form)
    @email_template = form.webform.email_template
    if form.webform.document_id.present?
      attachments[form.webform.document.file_file_name] = File.read form.webform.document.file.path
    end
    mail :from  => Key['webform.from'],
         :subject => (form.webform.email_subject || form.webform.name),
         :to => submitter_of(form)
  end
  
  private
  
  def setup_recipients(webform)    
    if webform.send_to_email.present?
      recipients webform.send_to_email
      return
    end
    users = User.administrators.all<commit_msg>change if present to unless blank<commit_after>class WebformMailer < ActionMailer::Base
  
  def admin_notification(form)
    setup_recipients(form.webform)
    from               submitter_of(form)
    subject            form.webform.name
    @form_data = form.attributes
  end
  
  def response(form)
    @email_template = form.webform.email_template
    if form.webform.document_id.present?
      attachments[form.webform.document.file_file_name] = File.read form.webform.document.file.path
    end
    mail :from  => Key['webform.from'],
         :subject => (form.webform.email_subject || form.webform.name),
         :to => submitter_of(form)
  end
  
  private
  
  def setup_recipients(webform)    
    unless webform.send_to_email.blank?
      recipients webform.send_to_email
      return
    end
    users = User.administrators.all
{'fraction_non_alphanumeric': 0.08904933814681107, 'fraction_numerical': 0.0, 'mean_word_length': 2.8674418604651164, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2335286', 'n_tokens_mistral': 532, 'n_tokens_neox': 527, 'n_words': 90}