Configure development confirmation email

Welcome xxx@xxxxx.com ! You can confirm your account by e-mail using the link below: enter the code hereConfirm my account

I want to edit this post to become like this

My project_name Hello xxxxx click here to verify your email address

+6
source share
3 answers

Just create development views.

rails g devise: views

then you will get access to the default mailing settings in

your_app / application / views / invent / mailer

  • confirmation_instructions.html.erb
  • reset_password_instructions.html.haml
  • unlock_instructions.html.haml
+11
source

Check devise.en.yml to find the translation. You can pass project_name for translation; eg:

t('welcome', :project_name => project.name)

And in the yml file:

welcome_message: 'My %{project_name} Hello xxxxx click here to confirm you email'

+4
source

I believe you wanted to set up a confirmation_instructions.html.erb file from app\view\resource\mailer , when usually the resource is a user or administrator

First of all, make sure you set config.scoped_views = true to config/initializers/devise.rb . Thanks to this, the installer looks for templates in your resource view folder, and not by default in app\views\devise\mailer

Using login , username , etc. possibly as follows <%= @resource.login %>

In the end, be sure to restart the server. For reference, check out a similar Ruby / Rails issue : how do you customize Devise mailer templates?

+1
source

Source: https://habr.com/ru/post/925011/


All Articles