lib/tasks/emails.rake
# This function sends the email to a file in caseflow/tmp
This function sends the email to a file in caseflow/tmp
This function sends the email to a file in caseflow / tmp
def write_output_to_file(file_name, email)
    body = email.html_part&.decoded || email.body
    subject = email.subject
    return if body.blank?
    output_file = Rails.root.join("tmp", file_name)
    File.write(output_file, subject, mode: "w")
    File.write(output_file, body, mode: "a")
  end
def write_output_to_file ( file_name , email ) body = email . html_part &. decoded || email . body subject = email . subject return if body . blank? output_file = Rails . root . join ( "tmp" , file_name ) File . write ( output_file , subject , mode : "w" ) File . write ( output_file , body , mode : "a" ) end
This function sends the email to a file in caseflow/tmp
This function sends the email to a file in caseflow / tmp
file_name
email