Files
docuseal/app/models/account_config.rb
T

72 lines
2.6 KiB
Ruby
Raw Normal View History

2023-08-16 22:57:59 +03:00
# frozen_string_literal: true
# == Schema Information
#
# Table name: account_configs
#
# id :bigint not null, primary key
# key :string not null
# value :text not null
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
#
# Indexes
#
# index_account_configs_on_account_id (account_id)
# index_account_configs_on_account_id_and_key (account_id,key) UNIQUE
#
# Foreign Keys
#
# fk_rails_... (account_id => accounts.id)
#
class AccountConfig < ApplicationRecord
SUBMITTER_INVITATION_EMAIL_KEY = 'submitter_invitation_email'
2023-08-20 00:10:54 +03:00
SUBMITTER_COMPLETED_EMAIL_KEY = 'submitter_completed_email'
SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY = 'submitter_documents_copy_email'
2023-09-17 20:38:09 +03:00
BCC_EMAILS = 'bcc_emails'
2023-12-02 01:50:54 +02:00
FORCE_MFA = 'force_mfa'
ALLOW_TYPED_SIGNATURE = 'allow_typed_signature'
2024-01-30 17:03:58 +02:00
ALLOW_TO_RESUBMIT = 'allow_to_resubmit'
2024-04-13 11:35:04 +03:00
SUBMITTER_REMINDERS = 'submitter_reminders'
2023-09-29 01:24:39 +03:00
FORM_COMPLETED_BUTTON_KEY = 'form_completed_button'
2024-04-05 16:16:30 +03:00
FORM_COMPLETED_MESSAGE_KEY = 'form_completed_message'
2024-01-26 17:43:52 +02:00
FORM_WITH_CONFETTI_KEY = 'form_with_confetti'
2023-12-21 23:29:06 +02:00
ESIGNING_PREFERENCE_KEY = 'esigning_preference'
2024-04-09 18:11:58 +03:00
WEBHOOK_PREFERENCES_KEY = 'webhook_preferences'
2024-04-15 19:58:24 +03:00
DOWNLOAD_LINKS_AUTH_KEY = 'download_links_auth'
2024-04-19 02:04:35 +03:00
FORCE_SSO_AUTH_KEY = 'force_sso_auth'
2024-04-22 21:34:55 +03:00
FLATTEN_RESULT_PDF_KEY = 'flatten_result_pdf'
2023-08-16 22:57:59 +03:00
DEFAULT_VALUES = {
SUBMITTER_INVITATION_EMAIL_KEY => {
2023-10-12 22:42:14 +03:00
'subject' => 'You are invited to submit a form',
2023-08-16 22:57:59 +03:00
'body' => "Hi there,\n\n" \
2023-10-12 22:42:14 +03:00
"You have been invited to submit the \"{{template.name}}\" form.\n\n" \
2023-08-16 22:57:59 +03:00
"{{submitter.link}}\n\n" \
"Please contact us by replying to this email if you didn't request this.\n\n" \
"Thanks,\n" \
'{{account.name}}'
2023-08-20 00:10:54 +03:00
},
SUBMITTER_COMPLETED_EMAIL_KEY => {
2023-09-09 23:14:15 +03:00
'subject' => '{{template.name}} has been completed by {{submission.submitters}}',
2023-08-20 00:10:54 +03:00
'body' => "Hi,\n\n" \
"\"{{template.name}}\" form has been completed by {{submission.submitters}}\n\n" \
'{{submission.link}}'
2023-08-20 00:10:54 +03:00
},
SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY => {
2023-10-12 22:42:14 +03:00
'subject' => 'Your document copy',
2023-08-20 00:10:54 +03:00
'body' => "Hi there,\n\n" \
"Please check the copy of your \"{{template.name}}\" submission in the email attachments.\n" \
2023-10-12 22:42:14 +03:00
"Alternatively, you can download your copy using:\n\n" \
"{{documents.link}}\n\n" \
2023-08-20 00:10:54 +03:00
"Thanks,\n" \
'{{account.name}}'
2023-08-16 22:57:59 +03:00
}
}.freeze
belongs_to :account
2023-12-29 18:50:14 +00:00
serialize :value, coder: JSON
2023-08-16 22:57:59 +03:00
end