From 4406087471eba23c7c0ea751db9e3c476e623303 Mon Sep 17 00:00:00 2001 From: Paul Arterburn Date: Mon, 8 Jan 2024 14:49:57 -0700 Subject: [PATCH] Stripe signatures --- app/lib/email_processor.rb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/lib/email_processor.rb b/app/lib/email_processor.rb index 591aa55c..f5e355be 100644 --- a/app/lib/email_processor.rb +++ b/app/lib/email_processor.rb @@ -24,14 +24,6 @@ def initialize(email) @attachments = email.attachments @user = find_user_from_user_key(@token, @from) - if @user.id == 1 - p "*"*100 - p "MESSAGE ID" - p email.headers&.dig("Message-ID") - p @message_id - p "*"*100 - end - @inbound_email_params = { subject: to_utf8(email.subject), cc: email.cc, @@ -335,14 +327,14 @@ def clean_html_version(html) html&.gsub!("", "")&.gsub!("", "")&.gsub!("", "")&.gsub!("", "")&.gsub!("", "")&.gsub!("", "") html = Rinku.auto_link(html, :all, 'target="_blank"') + html = html.split("
").first # strip out gmail signature + html = html.split('
').first # strip out gmail signature + html = html.split('
').first # strip out gmail signature html = ActionController::Base.helpers.sanitize(html, tags: %w(strong em a div span ul ol li b i br p hr u em blockquote), attributes: %w(href target)) html = html.split("
--
").first # strip out gmail signature html = html.split("

\n
--
").first # strip out gmail signature html = html.split("
--").first # strip out gmail signature html = html.split("
\n--").first # strip out gmail signature - html = html.split("
").first # strip out gmail signature - html = html.split('
').first # strip out gmail signature - html = html.split('
').first # strip out gmail signature html&.gsub!(/\A/, "") # remove
from very beginning of html html&.gsub!(/
.+<\/div>/, "") # remove hidden divs / tracking pixels html&.gsub!(/src=\"cid\:\S+\"/, "src=\"\" style=\"display: none;\"") # remove attached images showing as broken inline images