I am trying to create an email from a template, and then also attach a .csv file to my email, however the email only comes through with the attachment and the content is ignored? Any idea what I’m doing wrong here?
def send_email(csv_file, results)
@subject = "subject here"
@from = "hl7_data mailer<hl7-data@email.com>"
@recipients = HL7_DATA_EMAIL_ADDRESS
@results = results
attachment :content_type => "text/csv", :body => csv_file
end
mailer_view/send_email.html.erb:
Here is my content for the hl7 data email file: <%=@results%>
My file content used to display correctly but once I attached a file, it stopped displaying?
Any idea why?
So here is what I was looking for:
So basically, I coulndt use the existing view file, I had to create inline content:
mailer_view/send_email.html.erb