2014-08-06 14:47:47 +02:00
|
|
|
# Sending mails related to events' notes
|
2015-07-25 18:32:27 +02:00
|
|
|
class NoteMailer < ApplicationMailer
|
2014-08-16 17:39:24 +02:00
|
|
|
helper :events
|
|
|
|
|
2014-07-21 01:26:58 +02:00
|
|
|
def notify(note)
|
2014-06-23 23:39:42 +02:00
|
|
|
@note = note
|
|
|
|
|
2015-04-18 17:24:15 +02:00
|
|
|
host = ActionMailer::Base.default_url_options[:host]
|
2014-08-06 14:47:47 +02:00
|
|
|
mail 'In-Reply-To' =>
|
2015-04-18 17:24:15 +02:00
|
|
|
"<event-#{note.event.id}@#{host}>",
|
2014-08-06 14:47:47 +02:00
|
|
|
to: note.event.submitter,
|
2014-09-20 17:20:40 +02:00
|
|
|
subject: "#{t 'mail_prefix'}#{t 'note_mailer.notify.subject',
|
|
|
|
subject: note.event.title}"
|
2014-07-21 01:26:58 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def create(note)
|
|
|
|
@note = note
|
|
|
|
|
2014-08-06 14:47:47 +02:00
|
|
|
mail 'In-Reply-To' =>
|
|
|
|
"<mod-#{note.event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
|
2014-09-20 17:20:40 +02:00
|
|
|
subject: "#{t 'mail_prefix'}#{t 'note_mailer.create.subject',
|
|
|
|
subject: note.event.title}"
|
2014-06-23 23:39:42 +02:00
|
|
|
end
|
|
|
|
end
|