diff --git a/app/mailers/event_mailer.rb b/app/mailers/event_mailer.rb index b3e4a3d..f20abc2 100644 --- a/app/mailers/event_mailer.rb +++ b/app/mailers/event_mailer.rb @@ -11,6 +11,12 @@ class EventMailer < ActionMailer::Base mail to: @event.user.email, from: 'program@openfest.org', subject: I18n.t('event_mailer.acceptance_notification.subject', conference: @event.conference.title, submission_type: @event.class.model_name.human.mb_chars.downcase.to_s, title: @event.title) end + def acceptance_second_notification(event) + @event = event + I18n.locale = @event.language + mail to: @event.user.email, from: 'program@openfest.org', subject: I18n.t('event_mailer.acceptance_notification.subject', conference: @event.conference.title, submission_type: @event.class.model_name.human.mb_chars.downcase.to_s, title: @event.title) + end + def rejection_notification(event) @event = event I18n.locale = 'bg' # XXX Change this when per-user locale is introduced in the user diff --git a/app/models/event.rb b/app/models/event.rb index a7d9391..f8615d9 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -25,6 +25,11 @@ class Event < ActiveRecord::Base touch :acceptance_notification_sent_at end + def send_acceptance_second_notification! + EventMailer.acceptance_second_notification(self).deliver + touch :acceptance_notification_sent_at + end + def send_rejection_notification! EventMailer.rejection_notification(self).deliver end