Skip to content

Commit

Permalink
Fallback so it saves
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Oct 5, 2024
1 parent 532c3af commit 63fb607
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/email_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(email)
@bcc = email.bcc
@subject = to_utf8(email.subject)
@stripped_html = email.vendor_specific.try(:[], :stripped_html)
@body = clean_message(email.body)
@body = clean_message(email.body).presence || "No entry provided."

@html = clean_html_version(@stripped_html)
@message_id = email.headers&.dig("Message-ID")&.gsub("<", "")&.gsub(">", "")
Expand Down Expand Up @@ -104,7 +104,7 @@ def process
date = parse_subject_for_date(@subject)
existing_entry = @user.existing_entry(date.to_s)
inspiration_id = parse_body_for_inspiration_id(@raw_body)
@body = @html if @html.present? && @user.is_pro?
@body = @html.presence if @html.present? && @user.is_pro?

if existing_entry.present?
existing_entry.original_email = @inbound_email_params
Expand Down

0 comments on commit 63fb607

Please sign in to comment.