mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Email notification on cfp dates updates and schedule made public
This commit is contained in:
parent
8cdf48c7df
commit
f5c53f77cf
6 changed files with 69 additions and 27 deletions
|
|
@ -10,7 +10,21 @@ class Admin::CallforpapersController < ApplicationController
|
|||
|
||||
def update
|
||||
@cfp = @conference.call_for_papers
|
||||
@cfp.assign_attributes(params[:call_for_papers])
|
||||
notify_on_schedule_public = @cfp.schedule_public_changed? && @cfp.schedule_public\
|
||||
&& @conference.email_settings.send_on_call_for_papers_schedule_public\
|
||||
&& !@conference.email_settings.call_for_papers_schedule_public_subject.blank?\
|
||||
&& !@conference.email_settings.call_for_papers_schedule_public_template.blank?
|
||||
|
||||
notify_on_cfp_date_update = !@cfp.end_date.blank? && !@cfp.start_date.blank?\
|
||||
&& (@cfp.start_date_changed? || @cfp.end_date_changed?)\
|
||||
&& @conference.email_settings.send_on_call_for_papers_dates_updates\
|
||||
&& !@conference.email_settings.call_for_papers_dates_updates_subject.blank?\
|
||||
&& !@conference.email_settings.call_for_papers_dates_updates_template.blank?
|
||||
|
||||
if @cfp.update_attributes(params[:call_for_papers])
|
||||
Mailbot.delay.send_on_call_for_papers_dates_updates(@conference) if notify_on_cfp_date_update
|
||||
Mailbot.delay.send_on_schedule_public(@conference) if notify_on_schedule_public
|
||||
redirect_to(admin_conference_callforpapers_path(
|
||||
id: @conference.short_title),
|
||||
notice: 'Call for Papers was successfully updated.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue