Last active
November 1, 2024 08:26
-
-
Save ThawanFidelis/ac4a215b841619eae7d8 to your computer and use it in GitHub Desktop.
Preview Devise Mails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/enviroments/development.rb | |
config.action_mailer.preview_path = "#{Rails.root}/app/mailer_previews" | |
# app/mailer_previews/devise_mailer_preview.rb | |
class Devise::MailerPreview < ActionMailer::Preview | |
def confirmation_instructions | |
Devise::Mailer.confirmation_instructions(User.first, {}) | |
end | |
def unlock_instructions | |
Devise::Mailer.unlock_instructions(User.first, "faketoken") | |
end | |
def reset_password_instructions | |
Devise::Mailer.reset_password_instructions(User.first, "faketoken") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The default path for RSpec users: spec/mailers/previews/devise_mailer_preview.rb
Seems to work with Devise module or Devise added to class name.
Thanks @ThawanFidelis