mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-28 09:24:24 +01:00
fix invoice attachement name
This commit is contained in:
parent
6f50d59054
commit
8a53ae2d2c
@ -28,12 +28,12 @@ class NotificationsMailer < NotifyWith::NotificationsMailer
|
||||
end
|
||||
|
||||
def notify_user_when_invoice_ready
|
||||
attachments['facture.pdf'] = File.read(@attached_object.file)
|
||||
attachments[@attached_object.filename] = File.read(@attached_object.file)
|
||||
mail(to: @recipient.email, subject: t('notifications_mailer.notify_member_invoice_ready.subject'), template_name: 'notify_member_invoice_ready')
|
||||
end
|
||||
|
||||
def notify_user_when_avoir_ready
|
||||
attachments['avoir.pdf'] = File.read(@attached_object.file)
|
||||
attachments[@attached_object.filename] = File.read(@attached_object.file)
|
||||
mail(to: @recipient.email, subject: t('notifications_mailer.notify_member_avoir_ready.subject'), template_name: 'notify_member_avoir_ready')
|
||||
end
|
||||
end
|
||||
|
@ -18,7 +18,11 @@ class Invoice < ActiveRecord::Base
|
||||
|
||||
# create directories if they doesn't exists (invoice & user_id)
|
||||
FileUtils::mkdir_p dir
|
||||
"#{dir}/#{ENV['INVOICE_PREFIX']}-#{self.id}_#{self.created_at.strftime('%d%m%Y')}.pdf"
|
||||
"#{dir}/#{self.filename}"
|
||||
end
|
||||
|
||||
def filename
|
||||
"#{ENV['INVOICE_PREFIX']}-#{self.id}_#{self.created_at.strftime('%d%m%Y')}.pdf"
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user