Customize the devise signed_up_but_unconfirmed mes

2019-05-26 05:34发布

问题:

Actually I want to customize signed_up_but_unconfirmed message the message is

A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.

and I want to add a user email id in the message. I want the following message

A message with a confirmation link has been sent to abc@example.com .Please follow the link to activate your account.

How do I customize those error messages?

回答1:

I think you can override Devise's en.yml file.

Copy it to config/locales/devise.en.yml, find there

signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."

and change it to:

signed_up_but_unconfirmed: "A message with a confirmation link has been sent to %{resource.email}. Please follow the link to activate your account."