37 lines
1.2 KiB
Ruby
37 lines
1.2 KiB
Ruby
require 'differ'
|
|
|
|
# Preview all emails at http://localhost:3000/rails/mailers/moderation_mailer
|
|
class ModerationMailerPreview < ActionMailer::Preview
|
|
# Preview this email at http://localhost:3000/rails/mailers/moderation_mailer/create
|
|
def create
|
|
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
|
|
ModerationMailer.create Event.last
|
|
end
|
|
|
|
# Preview this email at http://localhost:3000/rails/mailers/moderation_mailer/update
|
|
def update
|
|
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
|
|
event = Event.last
|
|
olderEvent = Event.new event.attributes
|
|
|
|
event.tags += ', ho'
|
|
event.start_time += 1.day
|
|
event.description = event.description + '
|
|
hello world'
|
|
|
|
ModerationMailer.update olderEvent, event, nil
|
|
end
|
|
|
|
# Preview this email at http://localhost:3000/rails/mailers/moderation_mailer/accept
|
|
def accept
|
|
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
|
|
ModerationMailer.accept Event.last, User.last
|
|
end
|
|
|
|
# Preview this email at http://localhost:3000/rails/mailers/moderation_mailer/destroy
|
|
def destroy
|
|
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
|
|
ModerationMailer.destroy Event.last, User.last, 'hello world'
|
|
end
|
|
end
|