To use a custom email layout with Rails 5 and Devise, open config/initializers/devise.rb and add this line:
# Use layouts for Devise
Then, add a new file to app/views/layouts called mylayout.html.erb:
<%= yield %>
Of course, you can change mylayout in both the Devise config and filename if you’d like to call it something different.
Remember to restart your server before testing this.