Skip to content

Instantly share code, notes, and snippets.

@dsandstrom
Forked from ThawanFidelis/preview_devise_mail.rb
Last active December 11, 2020 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsandstrom/619ee5885ebc4d9f5fa7dcb8fb1c857f to your computer and use it in GitHub Desktop.
Save dsandstrom/619ee5885ebc4d9f5fa7dcb8fb1c857f to your computer and use it in GitHub Desktop.
Preview Devise Mails
# spec/mailers/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