2014-08-06 21:14:00 +03:00
|
|
|
module Admin
|
2014-08-13 14:37:05 +03:00
|
|
|
class EmailsController < Admin::BaseController
|
2014-08-12 11:51:59 +03:00
|
|
|
load_and_authorize_resource :conference, find_by: :short_title
|
|
|
|
|
load_and_authorize_resource class: EmailSettings
|
2013-01-14 08:49:49 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def update
|
2015-10-28 18:05:15 +02:00
|
|
|
@conference.email_settings.update_attributes(email_params)
|
2016-03-11 02:08:00 +05:30
|
|
|
redirect_to admin_conference_emails_path(
|
2014-08-06 21:14:00 +03:00
|
|
|
@conference.short_title),
|
2016-03-11 02:08:00 +05:30
|
|
|
notice: 'Settings have been successfully updated.'
|
2014-08-06 21:14:00 +03:00
|
|
|
end
|
2013-01-14 08:49:49 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def index
|
2014-08-12 11:51:59 +03:00
|
|
|
authorize! :index, @conference.email_settings
|
2014-08-06 21:14:00 +03:00
|
|
|
@settings = @conference.email_settings
|
|
|
|
|
end
|
2015-10-28 18:05:15 +02:00
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def email_params
|
|
|
|
|
params.require(:email_settings).permit(:send_on_registration, :send_on_accepted, :send_on_rejected, :send_on_confirmed_without_registration,
|
|
|
|
|
:registration_subject, :accepted_subject, :rejected_subject, :confirmed_without_registration_subject,
|
|
|
|
|
:registration_body, :accepted_body, :rejected_body, :confirmed_without_registration_body,
|
|
|
|
|
:send_on_conference_dates_updated, :conference_dates_updated_subject, :conference_dates_updated_body,
|
|
|
|
|
:send_on_conference_registration_dates_updated, :conference_registration_dates_updated_subject, :conference_registration_dates_updated_body,
|
|
|
|
|
:send_on_venue_updated, :venue_updated_subject, :venue_updated_body,
|
|
|
|
|
:send_on_call_for_papers_dates_updated, :call_for_papers_dates_updated_subject, :call_for_papers_dates_updated_body,
|
|
|
|
|
:send_on_call_for_papers_schedule_public, :call_for_papers_schedule_public_subject, :call_for_papers_schedule_public_body)
|
|
|
|
|
end
|
2013-01-14 08:49:49 +01:00
|
|
|
end
|
|
|
|
|
end
|