Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Jan 8, 2024
1 parent f7b71af commit 1e6a8bf
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/lib/email_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ 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(">", "")

@raw_body = to_utf8(email.raw_body)
@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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1e6a8bf

Please sign in to comment.