forked from saurabh/orbit4-5
fixed orbit mailer for no file title
This commit is contained in:
parent
b33c2d5b38
commit
d4df227811
|
@ -29,9 +29,16 @@ class OrbitMailer < ActionMailer::Base
|
|||
|
||||
unless email.email_files.blank?
|
||||
email.email_files.each_with_index do |email_file, i|
|
||||
unless email_file.file.blank?
|
||||
if !email_file.title.blank?
|
||||
file_type = File.extname(email_file.file.to_s)
|
||||
# file_content = File.read(email_file.file.url)
|
||||
attachments["#{email_file.title}#{file_type}"] = email_file.file.read
|
||||
else
|
||||
file_name = File.basename(email_file.file.path)
|
||||
attachments["#{file_name}"] = email_file.file.read
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue