<commit_before>Spree::HomeController.class_eval do

  def subscribenewsletter
    name=params[:name] || ''
    email=params[:email]
    receipt=params[:receipt] || ''
    subject=params[:subject] || 'Customer Record'
    if receipt.length>0
      external_key = Spree::BrontoConfiguration.account[current_store.code]["simple_send"]
      params.delete('action')
      params.delete('receipt')
      params.delete('authenticity_token')
      params.delete('controller')
      params.delete('subject')
      params.delete('cc_receipt')
      the_content=''
      ks=[]
      vs=[]
      params.each do |k,v|
        ks << k
        vs << v
      end
      the_content = ks.join(',') + '<br/>' + vs.join(',')
      et_a={:SENDTIME__CONTENT2 => the_content, :SENDTIME__CONTENT1 => subject}
      #et_a={:SENDTIME__CONTENT2 => 'Name: ' + name +'<br/>Email: ' + email + '<br/>Address: ' + params[:address]  + '<br/>City: ' + params[:city] + '<br/>State: ' + params[:state]  +'<br/>Zip: ' + params[:zip]  +'<br/>Phone: ' + params[:phone]  +'<br/>Credentials: ' + params[:credentials]}
      Delayed::Job.enqueue DelayedSimpleSend.new(current_store.code, receipt, external_key, et_a,'html')
      cc_receipt= params[:cc_receipt] || ''
      if cc_receipt.length>0
        Delayed::Job.enqueue DelayedSimpleSend.new(current_store.code, cc_receipt, external_key, et_a,'html')
      end
    end
    if email.length>0
      if current_store.code == 'pwb'
        title='Pets & Products Newsletter'
      elsif current_store.code == 'he'
        title='HairEssentials Products Newsletter'
      else
        title='Natural Products Newsletter'
      end
      campaign= Spree::BrontoList.find_by_title(title)
      if !!campaign
        Delayed::Job.enqueue DelayedSubscriberAdd.new(current_store.code, email, campaign, {:First_Name => name})
      end
      render :json => ({
                 :success => true,
                 :message => t( :subscription_sent )
             }).to_json
    else
      render :json => ({
                 :success => false,
                 :message => t( :subscription_notsent )
             }).to_json
    end
    #redirect_to "/meetexperts"<commit_msg>whole sale form data format update<commit_after>Spree::HomeController.class_eval do

  def subscribenewsletter
    name=params[:name] || ''
    email=params[:email]
    receipt=params[:receipt] || ''
    subject=params[:subject] || 'Customer Record'
    if receipt.length>0
      external_key = Spree::BrontoConfiguration.account[current_store.code]["simple_send"]
      params.delete('action')
      params.delete('receipt')
      params.delete('authenticity_token')
      params.delete('controller')
      params.delete('subject')
      params.delete('cc_receipt')
      the_content=''
      params.each do |k,v|
        the_content += k + ' : ' + v +'<br/>'
      end
      et_a={:SENDTIME__CONTENT2 => the_content, :SENDTIME__CONTENT1 => subject}
      #et_a={:SENDTIME__CONTENT2 => 'Name: ' + name +'<br/>Email: ' + email + '<br/>Address: ' + params[:address]  + '<br/>City: ' + params[:city] + '<br/>State: ' + params[:state]  +'<br/>Zip: ' + params[:zip]  +'<br/>Phone: ' + params[:phone]  +'<br/>Credentials: ' + params[:credentials]}
      Delayed::Job.enqueue DelayedSimpleSend.new(current_store.code, receipt, external_key, et_a,'html')
      cc_receipt= params[:cc_receipt] || ''
      if cc_receipt.length>0
        Delayed::Job.enqueue DelayedSimpleSend.new(current_store.code, cc_receipt, external_key, et_a,'html')
      end
    end
    if email.length>0
      if current_store.code == 'pwb'
        title='Pets & Products Newsletter'
      elsif current_store.code == 'he'
        title='HairEssentials Products Newsletter'
      else
        title='Natural Products Newsletter'
      end
      campaign= Spree::BrontoList.find_by_title(title)
      if !!campaign
        Delayed::Job.enqueue DelayedSubscriberAdd.new(current_store.code, email, campaign, {:First_Name => name})
      end
      render :json => ({
                 :success => true,
                 :message => t( :subscription_sent )
             }).to_json
    else
      render :json => ({
                 :success => false,
                 :message => t( :subscription_notsent )
             }).to_json
    end
    #redirect_to "/meetexperts"
{'fraction_non_alphanumeric': 0.14922255743792062, 'fraction_numerical': 0.002784868879090276, 'mean_word_length': 2.8516532618409296, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 45, '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': '6954259', 'n_tokens_mistral': 1407, 'n_tokens_neox': 1355, 'n_words': 242}