You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.4 KiB

  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.new(text: '', action: :silence), [Status.first.id])
  68. end
  69. # Preview this email at http://localhost:3000/rails/mailers/user_mailer/sign_in_token
  70. def sign_in_token
  71. UserMailer.sign_in_token(User.first.tap { |user| user.generate_sign_in_token }, '127.0.0.1', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0', Time.now.utc)
  72. end
  73. end