dan
dan

Reputation: 1080

Missing devise mailer template

I'm getting a missing template error with devise - it's probably a simple error but I can't see it. I have -

../mailers/user_mailer.rb

class UserMailer < ::ActionMailer::Base
  include Devise::Mailers::Helpers
  default :from => "[email protected]"
  def confirmation_instructions(record, token, opts={})
      @token = token
      devise_mail(record, :confirmation_instructions, opts)
    end
...

...and a template generated by devise -

../views/users/mailer/confirmation_instructions.html.erb

... but I'm getting a template missing error -

Missing template user_mailer/confirmation_instructions with "mailer". Searched in: * "user_mailer"

Why is the mailer template not being found?

Upvotes: 1

Views: 924

Answers (1)

Antima Gupta
Antima Gupta

Reputation: 381

your confirmation_instructions.html.erb file should be in user_mailer folder in views.

path like this ../views/user_mailer/confirmation_instructions.html.erb

insted of this ../views/users/mailer/confirmation_instructions.html.erb

Upvotes: 5

Related Questions