mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
600 B
19 lines
600 B
# frozen_string_literal: true
|
|
|
|
class SubmittersSendEmailController < ApplicationController
|
|
def create
|
|
submitter = Submitter.joins(:template)
|
|
.where(template: { account_id: current_account.id })
|
|
.find_by!(slug: params[:submitter_slug])
|
|
|
|
SubmitterMailer.invitation_email(submitter).deliver_later!
|
|
|
|
SubmissionEvent.create!(submitter:, event_type: 'send_email')
|
|
|
|
submitter.sent_at ||= Time.current
|
|
submitter.save!
|
|
|
|
redirect_back(fallback_location: submission_path(submitter.submission), notice: 'Email has been sent')
|
|
end
|
|
end
|