user_mailer_preview.rb 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Preview all emails at http://localhost:3000/rails/mailers/user_mailer
  2. class UserMailerPreview < ActionMailer::Preview
  3. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/confirmation_instructions
  4. def confirmation_instructions
  5. UserMailer.confirmation_instructions(User.first, 'spec')
  6. end
  7. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/email_changed
  8. def email_changed
  9. user = User.first
  10. user.unconfirmed_email = 'foo@bar.com'
  11. UserMailer.email_changed(user)
  12. end
  13. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/password_change
  14. def password_change
  15. UserMailer.password_change(User.first)
  16. end
  17. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/two_factor_disabled
  18. def two_factor_disabled
  19. UserMailer.two_factor_disabled(User.first)
  20. end
  21. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/two_factor_enabled
  22. def two_factor_enabled
  23. UserMailer.two_factor_enabled(User.first)
  24. end
  25. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/two_factor_recovery_codes_changed
  26. def two_factor_recovery_codes_changed
  27. UserMailer.two_factor_recovery_codes_changed(User.first)
  28. end
  29. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/webauthn_enabled
  30. def webauthn_enabled
  31. UserMailer.webauthn_enabled(User.first)
  32. end
  33. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/webauthn_disabled
  34. def webauthn_disabled
  35. UserMailer.webauthn_disabled(User.first)
  36. end
  37. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/webauthn_credential_added
  38. def webauthn_credential_added
  39. webauthn_credential = WebauthnCredential.new(nickname: 'USB Key')
  40. UserMailer.webauthn_credential_added(User.first, webauthn_credential)
  41. end
  42. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/webauthn_credential_deleted
  43. def webauthn_credential_deleted
  44. webauthn_credential = WebauthnCredential.new(nickname: 'USB Key')
  45. UserMailer.webauthn_credential_deleted(User.first, webauthn_credential)
  46. end
  47. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/reconfirmation_instructions
  48. def reconfirmation_instructions
  49. user = User.first
  50. user.unconfirmed_email = 'foo@bar.com'
  51. UserMailer.confirmation_instructions(user, 'spec')
  52. end
  53. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/reset_password_instructions
  54. def reset_password_instructions
  55. UserMailer.reset_password_instructions(User.first, 'spec')
  56. end
  57. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/welcome
  58. def welcome
  59. UserMailer.welcome(User.first)
  60. end
  61. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/backup_ready
  62. def backup_ready
  63. UserMailer.backup_ready(User.first, Backup.first)
  64. end
  65. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/warning
  66. def warning
  67. UserMailer.warning(User.first, AccountWarning.last)
  68. end
  69. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/appeal_approved
  70. def appeal_approved
  71. UserMailer.appeal_approved(User.first, Appeal.last)
  72. end
  73. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/suspicious_sign_in
  74. def suspicious_sign_in
  75. UserMailer.suspicious_sign_in(User.first, '127.0.0.1', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0', Time.now.utc)
  76. end
  77. end