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.
		
		
		
		
		
			
		
			
				
					
					
						
							17 lines
						
					
					
						
							512 B
						
					
					
				
			
		
		
	
	
							17 lines
						
					
					
						
							512 B
						
					
					
				# frozen_string_literal: true
 | 
						|
 | 
						|
class SubmittersSendEmailController < ApplicationController
 | 
						|
  load_and_authorize_resource :submitter, id_param: :submitter_slug, find_by: :slug
 | 
						|
 | 
						|
  def create
 | 
						|
    SubmitterMailer.invitation_email(@submitter).deliver_later!
 | 
						|
 | 
						|
    SubmissionEvent.create!(submitter: @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
 |