Add Event#send_acceptance_second_notification

This commit is contained in:
Petko Bordjukov 2014-10-20 22:36:21 +03:00
parent 21f854ea56
commit 26e523dc2f
2 changed files with 11 additions and 0 deletions

View File

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

View File

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