[Fix #196] Attestation: join the attestation to the closed mail
Add a upper limit to the attachment size as it could be a problem with Mailjet and receiver (https://www.mailjet.com/support/what-is-the-size-limit-for-attachments-files-sent-via-mailjet,289.htm) If the attestation cannot be sent, it is logged in sentry
This commit is contained in:
parent
b664709c3d
commit
e60ce35ae8
7 changed files with 114 additions and 18 deletions
|
@ -2,4 +2,10 @@ class Attestation < ApplicationRecord
|
|||
belongs_to :dossier
|
||||
|
||||
mount_uploader :pdf, AttestationUploader
|
||||
|
||||
MAX_SIZE_EMAILABLE = 2.megabytes
|
||||
|
||||
def emailable?
|
||||
pdf.size <= MAX_SIZE_EMAILABLE
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue