demarches-normaliennes/app/controllers/manager/email_events_controller.rb
2024-08-22 09:26:48 +02:00

27 lines
617 B
Ruby

# frozen_string_literal: true
module Manager
class EmailEventsController < Manager::ApplicationController
def index
@dolist_enabled = Dolist::API.new.properly_configured?
super
end
def generate_dolist_report
email = current_super_admin.email
DolistReportJob.perform_later(email)
respond_to do |format|
@message = "Le rapport sera envoyé sur #{email}. Il peut prendre plus d'1h pour être généré."
format.turbo_stream
format.html do
redirect_to manager_email_events_path, notice: @message
end
end
end
end
end