From 1e6a8bf814b9342fe305ea712fcf6c6205791fee Mon Sep 17 00:00:00 2001 From: Paul Arterburn Date: Mon, 8 Jan 2024 12:43:27 -0700 Subject: [PATCH] debugging --- app/lib/email_processor.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/lib/email_processor.rb b/app/lib/email_processor.rb index 53d393dc..1af1e5cb 100644 --- a/app/lib/email_processor.rb +++ b/app/lib/email_processor.rb @@ -16,6 +16,7 @@ def initialize(email) @subject = to_utf8(email.subject) @stripped_html = email.vendor_specific.try(:[], :stripped_html) @body = clean_message(email.body) + @html = clean_html_version(@stripped_html) @message_id = email.headers&.dig("Message-ID")&.gsub("<", "")&.gsub(">", "") @@ -23,6 +24,12 @@ def initialize(email) @attachments = email.attachments @user = find_user_from_user_key(@token, @from) + if @user.id == 1 + p "*"*100 + p @stripped_html + p "*"*100 + end + @inbound_email_params = { subject: to_utf8(email.subject), cc: email.cc, @@ -59,7 +66,19 @@ def process end end + if @user.id == 1 + p "*"*100 + p valid_attachments + p "*"*100 + end + if valid_attachments.size > 1 + if @user.id == 1 + p "*"*100 + p "COLLAGING IMAGES FROM MAILGUN" + p "*"*100 + end + best_attachment_url = collage_from_mailgun_attachments elsif valid_attachments.any? best_attachment = valid_attachments.first @@ -372,6 +391,12 @@ def collage_from_mailgun_attachments end.compact return nil unless attachment_urls.any? + if @user.id == 1 + p "*"*100 + p attachment_urls + p "*"*100 + end + collage_from_urls(attachment_urls) end