Two layouts in one mailer

Hi all,

I’m having problems figuring out how to know which mailer method is being invoked in the layout callback.

In my controller, I have code like this and its working great:

class Users::RegistrationsController < Devise::RegistrationsController

layout :devise_or_application

def devise_or_application

[“edit”, “update”, “destroy”].include?(params[:action]) ? “application” : “devise”

end

end

Now I need the same thing for my mailer, but params[:action] is not available in mailers. Is there another way to use different layout in one mailer, based on which mailer method is being called, like above?

Mailer in question is a custom Devise mailer (inheriting from default Devise mailer), so I can’t really use different mailer, as Devise allows me to configure only one mailer to be used.

Thanks in advance!