2018-08-15 17:45:57 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-03-22 20:27:36 -04:00
|
|
|
class DeviseMailerPreview < ActionMailer::Preview
|
|
|
|
def confirmation_instructions_for_signup
|
2016-05-25 17:53:26 -04:00
|
|
|
DeviseMailer.confirmation_instructions(unsaved_user, 'faketoken', {})
|
2016-03-22 20:27:36 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def confirmation_instructions_for_new_email
|
|
|
|
user = User.last
|
2016-05-25 17:53:26 -04:00
|
|
|
user.unconfirmed_email = 'unconfirmed@example.com'
|
|
|
|
|
2016-03-22 20:27:36 -04:00
|
|
|
DeviseMailer.confirmation_instructions(user, 'faketoken', {})
|
|
|
|
end
|
2016-05-25 17:53:26 -04:00
|
|
|
|
|
|
|
def reset_password_instructions
|
|
|
|
DeviseMailer.reset_password_instructions(unsaved_user, 'faketoken', {})
|
|
|
|
end
|
|
|
|
|
|
|
|
def unlock_instructions
|
|
|
|
DeviseMailer.unlock_instructions(unsaved_user, 'faketoken', {})
|
|
|
|
end
|
|
|
|
|
|
|
|
def password_change
|
|
|
|
DeviseMailer.password_change(unsaved_user, {})
|
|
|
|
end
|
|
|
|
|
2020-11-12 16:09:19 -05:00
|
|
|
def user_admin_approval
|
|
|
|
DeviseMailer.user_admin_approval(unsaved_user, {})
|
|
|
|
end
|
|
|
|
|
2016-05-25 17:53:26 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
def unsaved_user
|
2021-01-13 13:10:55 -05:00
|
|
|
User.new(name: 'Jane Doe', email: 'jdoe@example.com', created_at: 1.minute.ago)
|
2016-05-25 17:53:26 -04:00
|
|
|
end
|
2016-03-22 20:27:36 -04:00
|
|
|
end
|