adjust email templates
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Docuseal
|
||||
PRODUCT_URL = 'https://www.docuseal.co'
|
||||
PRODUCT_NAME = 'DocuSeal'
|
||||
DEFAULT_APP_URL = 'http://localhost:3000'
|
||||
|
||||
module_function
|
||||
|
||||
def multitenant?
|
||||
ENV['MULTITENANT'] == true
|
||||
end
|
||||
|
||||
def default_url_options
|
||||
@default_url_options ||= begin
|
||||
value = EncryptedConfig.find_by(key: EncryptedConfig::APP_URL_KEY)&.value
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module GenerateCertificate
|
||||
NAME = 'DocuSeal'
|
||||
NAME = Docuseal::PRODUCT_NAME
|
||||
SIZE = 2**11
|
||||
|
||||
module_function
|
||||
|
||||
@@ -5,7 +5,8 @@ module Submissions
|
||||
FONT_SIZE = 11
|
||||
FONT_NAME = 'Helvetica'
|
||||
|
||||
INFO_CREATOR = 'DocuSeal (https://www.docuseal.co)'
|
||||
INFO_CREATOR = "#{Docuseal::PRODUCT_NAME} (#{Docuseal::PRODUCT_URL})".freeze
|
||||
SIGN_REASON = 'Signed by %<email>s with docuseal.co'
|
||||
|
||||
TEXT_LEFT_MARGIN = 1
|
||||
TEXT_TOP_MARGIN = 1
|
||||
@@ -184,7 +185,7 @@ module Submissions
|
||||
|
||||
pdf.trailer.info[:Creator] = INFO_CREATOR
|
||||
|
||||
pdf.sign(io, reason: "Signed by #{submitter.email} with docuseal.co",
|
||||
pdf.sign(io, reason: format(SIGN_REASON, email: submitter.email),
|
||||
certificate: OpenSSL::X509::Certificate.new(cert['cert']),
|
||||
key: OpenSSL::PKey::RSA.new(cert['key']),
|
||||
certificate_chain: [OpenSSL::X509::Certificate.new(cert['sub_ca']),
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Submitters
|
||||
module_function
|
||||
|
||||
def select_attachments_for_download(submitter)
|
||||
original_documents = submitter.submission.template.documents.preload(:blob)
|
||||
is_more_than_two_images = original_documents.count(&:image?) > 1
|
||||
|
||||
submitter.documents.preload(:blob).reject do |attachment|
|
||||
is_more_than_two_images && original_documents.find { |a| a.uuid == attachment.uuid }&.image?
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user