From 26e523dc2f76194b4652d5cd90a93fea08f5dc5d Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Mon, 20 Oct 2014 22:36:21 +0300 Subject: [PATCH] Add Event#send_acceptance_second_notification --- app/mailers/event_mailer.rb | 6 ++++++ app/models/event.rb | 5 +++++ 2 files changed, 11 insertions(+) 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