Add emails for booth's acceptance and rejection
This commit is contained in:
parent
5f9c0065c6
commit
7107f9a35f
11 changed files with 114 additions and 10 deletions
|
|
@ -47,7 +47,18 @@ module Admin
|
|||
end
|
||||
|
||||
def accept
|
||||
update_state(:accept, 'Booth accepted!')
|
||||
@booth.accept!
|
||||
|
||||
if @booth.save
|
||||
if @conference.email_settings.send_on_booths_acceptance
|
||||
Mailbot.conference_booths_acceptance_mail(@booth).deliver
|
||||
end
|
||||
redirect_to admin_conference_booths_path(conference_id: @conference.short_title),
|
||||
notice: 'Booth successfully accepted!'
|
||||
else
|
||||
redirect_to admin_conference_booths_path(conference_id: @conference.short_title)
|
||||
flash[:error] = "Booth could not be accepted. #{@booth.errors.full_messages.to_sentence}."
|
||||
end
|
||||
end
|
||||
|
||||
def to_accept
|
||||
|
|
@ -59,7 +70,16 @@ module Admin
|
|||
end
|
||||
|
||||
def reject
|
||||
update_state(:reject, 'Booth rejected')
|
||||
@booth.reject!
|
||||
|
||||
if @booth.save
|
||||
Mailbot.conference_booths_rejection_mail(@booth).deliver
|
||||
redirect_to admin_conference_booths_path(conference_id: @conference.short_title),
|
||||
notice: 'Booth successfully rejected.'
|
||||
else
|
||||
redirect_to admin_conference_booths_path(conference_id: @conference.short_title)
|
||||
flash[:error] = "Booth could not be rejected. #{@booth.errors.full_messages.to_sentence}."
|
||||
end
|
||||
end
|
||||
|
||||
def restart
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ module Admin
|
|||
: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_cfp_dates_updated, :cfp_dates_updated_subject, :cfp_dates_updated_body,
|
||||
:send_on_program_schedule_public, :program_schedule_public_subject, :program_schedule_public_body)
|
||||
:send_on_program_schedule_public, :program_schedule_public_subject, :program_schedule_public_body,
|
||||
:send_on_booths_acceptance, :booths_acceptance_subject, :booths_acceptance_body,
|
||||
:send_on_booths_rejection, :booths_rejection_subject, :booths_rejection_body)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue