def show_attachment
      with_email_locale do
        filename   = "#{params[:filename]}.#{params[:format]}"
        attachment = preview_mail(false).attachments.find { |a| a.filename == filename }
        send_data attachment.body.raw_source, filename: filename
      end
    end
def show_attachment
      with_email_locale do
        filename   = "#{params[:filename]}.#{params[:format]}"
        attachment = preview_mail(false).attachments.find { |a| a.filename == filename }
        send_data attachment.body.raw_source, filename: filename
      end
    end
Download attachment