# Sending mails related to events' notes class NoteMailer < ApplicationMailer helper :events def notify(note) @note = note host = ActionMailer::Base.default_url_options[:host] mail 'In-Reply-To' => "", to: note.event.submitter, subject: subject(note.event), 'Content-Language': locale end def create(note) @note = note mail 'In-Reply-To' => "", subject: subject(note.event), 'Content-Language': locale end private def subject(event) t('mail_prefix') + t("#{mailer_name}.#{action_name}.subject", subject: event.title) end end