user_mailer_preview.rb 3.7 KB

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