I'm trying to use Devise with multiple scopes without overriding the Devise controllers until I absolutely have to. I think I may have reached a point to where I finally will have to override the controllers.
I have three different portals/scopes called faculty, professor, and student and they all use the user devise model. Each one of these scopes has their own devise views and custom sign in templates.
The issue I am having is I get the same confirmation e- mail template regardless of the scope I'm signed in. The one I keep getting is the first one defined in my routes.rb file. For example:
devise_for :students, :class_name => 'User',
:path_names => { :sign_in => 'login', :sign_out =>'logout', :sign_up => 'signup' }
resources :students
devise_for :faculty, :class_name => 'User',
:path_names => { :sign_in => 'login', :sign_out =>'logout', :sign_up => 'signup' }
resources :faculty
devise_for :professors, :class_name => 'User',
:path_names => { :sign_in => 'login', :sign_out =>'logout', :sign_up => 'signup' }
resources :professors
devise_for :users,
:path_names => { :sign_in => 'login', :sign_out => 'logout',:sign_up => 'signup' }
resources :users
Every time I get a confirmation e-mail it will use the student confirmation email template. If I move faculty to the top, I'll get the faculty email and so on.
Is there a way to get each scope to send their respective confirmation e-mail template without having to override Devise?