Files
docuseal/app/models/account_config.rb
T

64 lines
2.2 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'
2023-09-17 20:38:09 +03:00
SUBMITTER_REMAILERS = 'submitter_reminders'
2023-09-29 01:24:39 +03:00
FORM_COMPLETED_BUTTON_KEY = 'form_completed_button'
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
serialize :value, JSON
end