mirror of https://github.com/docusealco/docuseal
parent
07e49f9f07
commit
62cea05084
@ -0,0 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SendSubmitterInvitationEmailJob < ApplicationJob
|
||||
def perform(submitter)
|
||||
SubmitterMailer.invitation_email(submitter).deliver_now!
|
||||
|
||||
submitter.sent_at ||= Time.current
|
||||
submitter.save
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,11 @@
|
||||
<% if template.submitters.size > 1 %>
|
||||
<div class="form-control">
|
||||
<%= f.label :preserve_order, for: uuid = SecureRandom.uuid, class: 'flex items-center cursor-pointer' do %>
|
||||
<%= f.check_box :preserve_order, id: uuid, class: 'base-checkbox', checked: template.submissions.last&.submitters_order.in?(['preserved', nil]) %>
|
||||
<span class="label">Preserve submitters order</span>
|
||||
<span class="tooltip" data-tip="When checked, notifications will be sent to the second submitter once the form is completed by the previous submitter. Uncheck this option to send notifications to all submitters simultaneously right away.">
|
||||
<%= svg_icon('info_circle', class: 'w-4 h-4') %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSubmittersOrderToSubmissions < ActiveRecord::Migration[7.0]
|
||||
class MigrationSubmission < ApplicationRecord
|
||||
self.table_name = 'submissions'
|
||||
end
|
||||
|
||||
def change
|
||||
add_column :submissions, :submitters_order, :string
|
||||
|
||||
MigrationSubmission.where(submitters_order: nil).update_all(submitters_order: 'random')
|
||||
|
||||
change_column_null :submissions, :submitters_order, false
|
||||
end
|
||||
end
|
||||
Loading…
Reference in new issue