Add emails for booth's acceptance and rejection

This commit is contained in:
nasia 2017-08-02 20:10:47 +03:00 committed by Stella Rouzi
parent 5f9c0065c6
commit 7107f9a35f
11 changed files with 114 additions and 10 deletions

View file

@ -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

View file

@ -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