locomotivecms/devise — comment on commit 09f39ea8c98665c85354610096b063cb1688f2ff
File:  line 0
By josevalim:

I don't think we need to manually pass the resource_name to all methods. If we have the model class (which we do!), we can get the mapping which we could then get the scope. Something like this:

def mailer_for(klass_or_symbol)
mapping = Devise::Mapping.find_scope!(klass_or_symbol)
Devise.mailer[mapping.name] || Devise.mailer[:default]
end