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

35 lines
1.1 KiB
Ruby
Raw Normal View History

2014-06-09 12:18:40 +02:00
class ModerationMailer < ActionMailer::Base
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)
2014-06-09 12:18:40 +02:00
end
def update(olderEvent, event, current_user)
@olderEvent = olderEvent
2014-06-09 12:18:40 +02:00
@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)
2014-06-09 12:18:40 +02:00
end
2014-07-01 15:50:39 +02:00
def accept(event, current_user)
2014-06-09 12:18:40 +02:00
@event = event
@current_user = current_user
mail 'In-Reply-To' => "<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
2014-07-01 15:50:39 +02:00
subject: t('moderation_mailer.accept.subject', subject: event.title)
end
def destroy(event, current_user, reason)
@event = event
@current_user = current_user
@reason = reason
mail 'In-Reply-To' => "<mod-#{event.id}@#{ActionMailer::Base.default_url_options[:host]}>",
subject: t('moderation_mailer.destroy.subject', subject: event.title)
2014-06-09 12:18:40 +02:00
end
end