Tengo un archivo paperclip'd que quiero añadir un archivo adjunto a mi correo electrónico ....paperclip + ActionMailer - ¿Agregar un archivo adjunto?
UserMailer clase < ActionMailer :: Base def XXXXXX_notification (registro) @record = Registro de
attachments ??? How to add a paperclip file?
mail(:to => "#{record.email}",
:subject => "XXXXXXXX"
)
end
No parece haber nada en el tema a través de Google, si usted tiene alguna idea, me encantaría escucharlo :)
Gracias
ACTUALIZACIÓN
@comment.attachments.each do |a|
tempfile = File.new("#{Rails.root.to_s}/tmp/#{a.attachment_file_name}", "w")
tempfile << open(a.authenticated_url())
tempfile.puts
attachments[a.attachment_file_name] = File.read("#{Rails.root.to_s}/tmp/#{a.attachment_file_name}")
# Delete it tempfile
#File.delete("#{Rails.root.to_s}/tmp/#{a.filename}")
end
gracias, pero es la apertura de un archivo de un clip que no puedo averiguar – AnApprentice
por eso es necesario descargar el archivo S3 y luego leerlo ?? No puedo acceder y crear el archivo adjunto? – AnApprentice
Sí. Debe tener el archivo descargado para adjuntarlo. –