<commit_before>class PagesController < ApplicationController

  skip_before_filter :authenticate_user!

  def work_with_us
    @message = Message.new
  end

  def form_company
    @message = Message.new
  end

  def form_contact
    @message = Message.new
  end


  def potential_advertiser
    @message=Message.new
  end


  def we

  end

  def faqs
    session[:body]="page-faq"
  end

  def contact_work_with_us
    @message = Message.new
    get_params(@message)
    if @message.valid?
      ContactMailerTrabajaConNosotros.new_message_trabaja_con_nosotros(@message).deliver
      flash.now.alert = "El mensaje se ha enviado correctamente."
      render pages_work_with_us_path

    else
      flash.now.alert = "Completa todos los datos por favor"
      render pages_work_with_us_path
    end

  end


  def contact
    @message = Message.new
    get_params(@message)
    if !current_user.nil?
      @message.email = current_user.email
      if current_user.company?
         @message.name = Company.where(:user_id => current_user.id).first().name
      else
        @message.name = Company.where(:user_id => current_user.id).first().first_name
      end
    end

    if @message.valid?
      ContactMailer.new_message(@message).deliver
      flash.now.alert = "El mensaje se ha enviado correctamente."
      render pages_form_contact_path
    else
      flash.now.alert = "Completa todos los datos por favor"<commit_msg>Fix mailers for user client<commit_after>class PagesController < ApplicationController

  skip_before_filter :authenticate_user!

  def work_with_us
    @message = Message.new
  end

  def form_company
    @message = Message.new
  end

  def form_contact
    @message = Message.new
  end


  def potential_advertiser
    @message=Message.new
  end


  def we

  end

  def faqs
    session[:body]="page-faq"
  end

  def contact_work_with_us
    @message = Message.new
    get_params(@message)
    @message.body = params[:message][:body]
    @message.name =  params[:message][:name]
    @message.email =  params[:message][:email]
    if @message.valid?
      ContactMailerTrabajaConNosotros.new_message_trabaja_con_nosotros(@message).deliver
      flash.now.alert = "El mensaje se ha enviado correctamente."
      render pages_work_with_us_path

    else
      flash.now.alert = "Completa todos los datos por favor"
      render pages_work_with_us_path
    end

  end


  def contact
    @message = Message.new
    get_params(@message)
    @message.body = params[:message][:body]
    @message.subject =  params[:message][:subject]
    if !current_user.nil?
      @message.email = current_user.email
      if current_user.company?
         @message.name = Company.where(:user_id => current_user.id).first().name
      else
        @message.name = Client.where(:user_id => current_user.id).first().first_name
        if @message.name.nil?
          @message.name = current_user.email
        end
      end
    end

    if @message.valid?
      ContactMailer.new_message(@message).deliver
      flash.now.alert = "El mensaje se ha enviado correctamente."
      render pages_form_contact_path
    else
      flash.now.alert = "Completa todos los datos por favor"
{'fraction_non_alphanumeric': 0.0869701726844584, 'fraction_numerical': 0.0, 'mean_word_length': 2.9825, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7040082', 'n_tokens_mistral': 1036, 'n_tokens_neox': 997, 'n_words': 218}