0

I've following setting in my Application.rb file

Devise::Mailer.layout "Mailer Layout Name"

I'm sending both HTML and NON-HTML(text) emails. I want to ignore the "Devise::Mailer.layout" for Non-HTML(text) email. Is there anyway to get this done in Devise and Rails.

I'm using Rails 4.2.4 & devise (3.5.1)

kashif
  • 1,097
  • 4
  • 17
  • 32

1 Answers1

0

This is standard ActionMailer functionality, not related to Devise.

class UserMailer < ActionMailer::Base
  layout :layout

  private

  def layout
    'my-layout' if content_type == 'text/html'
  end
end
Mihai Dinculescu
  • 19,743
  • 8
  • 55
  • 70