- Change `user.send(:activate)` to `user.activate` for clarity. - Fix typo in email parameter from `emial` to `email` in password reset. - Update render calls to include status codes for better error handling. - Modify password reset email method to accept a user parameter. - Update tests to reflect changes in password reset functionality. These changes improve the clarity of the user activation process and ensure that the password reset functionality works correctly with proper error handling and user feedback.
22 lines
554 B
Ruby
22 lines
554 B
Ruby
class UserMailer < ApplicationMailer
|
|
# Subject can be set in your I18n file at config/locales/en.yml
|
|
# with the following lookup:
|
|
#
|
|
# en.user_mailer.account_activation.subject
|
|
#
|
|
def account_activation(user)
|
|
@user = user
|
|
mail to: user.email, subject: "Account activation"
|
|
end
|
|
|
|
# Subject can be set in your I18n file at config/locales/en.yml
|
|
# with the following lookup:
|
|
#
|
|
# en.user_mailer.password_reset.subject
|
|
#
|
|
def password_reset(user)
|
|
@user = user
|
|
mail to: user.email, subject: "Password reset"
|
|
end
|
|
end
|