mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Switch mail sending to active_job
Before we were using the delayed_job method of delaying mail sending which isn't working anymore on rails 4.
This commit is contained in:
parent
14011f8828
commit
21280cd9d8
9 changed files with 12 additions and 11 deletions
|
|
@ -31,7 +31,7 @@ module Admin
|
|||
send_mail_on_cfp_dates_updates = @cfp.notify_on_cfp_date_update?
|
||||
|
||||
if @cfp.update_attributes(cfp_params)
|
||||
Mailbot.delay.send_on_cfp_dates_updates(@conference) if send_mail_on_cfp_dates_updates
|
||||
Mailbot.send_on_cfp_dates_updates(@conference).deliver_later if send_mail_on_cfp_dates_updates
|
||||
redirect_to admin_conference_program_cfp_path(@conference.short_title),
|
||||
notice: 'Call for papers successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ module Admin
|
|||
send_mail_on_conf_update = @conference.notify_on_dates_changed?
|
||||
|
||||
if @conference.update_attributes(conference_params)
|
||||
Mailbot.delay.conference_date_update_mail(@conference) if send_mail_on_conf_update
|
||||
Mailbot.conference_date_update_mail(@conference).deliver_later if send_mail_on_conf_update
|
||||
redirect_to edit_admin_conference_path(id: @conference.short_title),
|
||||
notice: 'Conference was successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ module Admin
|
|||
send_mail_on_schedule_public = @program.notify_on_schedule_public?
|
||||
|
||||
if @program.update_attributes(program_params)
|
||||
Mailbot.delay.send_on_schedule_public(@conference) if send_mail_on_schedule_public
|
||||
Mailbot.send_on_schedule_public(@conference).deliver_later if send_mail_on_schedule_public
|
||||
redirect_to admin_conference_program_path(@conference.short_title),
|
||||
notice: 'The program was successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ module Admin
|
|||
send_mail_on_reg_update = @conference.notify_on_registration_dates_changed?
|
||||
|
||||
if @registration_period.save
|
||||
Mailbot.delay.conference_registration_date_update_mail(@conference) if send_mail_on_reg_update
|
||||
Mailbot.conference_registration_date_update_mail(@conference).deliver_later if send_mail_on_reg_update
|
||||
redirect_to admin_conference_registration_period_path(@conference.short_title),
|
||||
notice: 'Registration Period successfully updated.'
|
||||
else
|
||||
|
|
@ -32,7 +32,7 @@ module Admin
|
|||
send_mail_on_reg_update = @conference.notify_on_registration_dates_changed?
|
||||
|
||||
if @registration_period.update(registration_period_params)
|
||||
Mailbot.delay.conference_registration_date_update_mail(@conference) if send_mail_on_reg_update
|
||||
Mailbot.conference_registration_date_update_mail(@conference).deliver_later if send_mail_on_reg_update
|
||||
redirect_to admin_conference_registration_period_path(@conference.short_title),
|
||||
notice: 'Registration Period successfully updated.'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -56,6 +56,6 @@ class Comment < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def send_notification
|
||||
Mailbot.delay.send_notification_email_for_comment(self)
|
||||
Mailbot.send_notification_email_for_comment(self).deliver_later
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class Event < ActiveRecord::Base
|
|||
program.conference.email_settings.confirmed_without_registration_body &&
|
||||
program.conference.email_settings.confirmed_without_registration_subject
|
||||
if program.conference.registrations.where(user_id: submitter.id).first.nil?
|
||||
Mailbot.delay.confirm_reminder_mail(self)
|
||||
Mailbot.confirm_reminder_mail(self).deliver_later
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -122,7 +122,7 @@ class Event < ActiveRecord::Base
|
|||
program.conference.email_settings.accepted_body &&
|
||||
program.conference.email_settings.accepted_subject &&
|
||||
!options[:send_mail].blank?
|
||||
Mailbot.delay.acceptance_mail(self)
|
||||
Mailbot.acceptance_mail(self).deliver_later
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ class Event < ActiveRecord::Base
|
|||
program.conference.email_settings.rejected_body &&
|
||||
program.conference.email_settings.rejected_subject &&
|
||||
!options[:send_mail].blank?
|
||||
Mailbot.delay.rejection_mail(self)
|
||||
Mailbot.rejection_mail(self).deliver_later
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class Registration < ActiveRecord::Base
|
|||
|
||||
def send_registration_mail
|
||||
if conference.email_settings.send_on_registration?
|
||||
Mailbot.delay.registration_mail(conference, user)
|
||||
Mailbot.registration_mail(conference, user).deliver_later
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class Venue < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def send_mail_notification
|
||||
Mailbot.delay.send_email_on_venue_updated(conference) if notify_on_venue_changed?
|
||||
Mailbot.send_email_on_venue_updated(conference).deliver_later if notify_on_venue_changed?
|
||||
end
|
||||
|
||||
def notify_on_venue_changed?
|
||||
|
|
|
|||
|
|
@ -64,5 +64,6 @@ module Osem
|
|||
# Errors raised within `after_rollback`/`after_commit` propagate normally
|
||||
# like in other Active Record callbacks.
|
||||
config.active_record.raise_in_transactional_callbacks = true
|
||||
config.active_job.queue_adapter = :delayed_job
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue