agenda-libre-ruby/app/mailers/moderation_mailer.rb

38 lines
1.2 KiB
Ruby

class ModerationMailer < ActionMailer::Base
default from: 'moderateurs@agendadulibre.org'
default to: 'moderateurs@agendadulibre.org'
def create(event)
@event = event
mail 'Message-ID' => "<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: t('moderation_mailer.create.subject', subject: event.title)
end
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.moderation_mailer.update.subject
#
def update(event, current_user)
@event = event
@current_user = current_user
mail 'In-Reply-To' => "<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: t('moderation_mailer.update.subject', subject: event.title)
end
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.moderation_mailer.moderate.subject
#
def moderate(event, current_user)
@event = event
@current_user = current_user
mail 'In-Reply-To' => "<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: t('moderation_mailer.moderate.subject', subject: event.title)
end
end