2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-01-09 17:36:26 +01:00
|
|
|
module Manager
|
|
|
|
class EmailEventsController < Manager::ApplicationController
|
2023-01-17 17:34:05 +01:00
|
|
|
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
|
2023-01-09 17:36:26 +01:00
|
|
|
end
|
|
|
|
end
|