How to use a different layout in Actionmailer messages?
问题 I have project_mailer with layout but I want to use different method if the project_notification method has parameter that unsubscribe_link = true . layout "project_mail" def project_notification(user, projects, unsubsribe_link = false) attachments.inline['logo_252.png'] = File.read(Rails.root + 'public/images/logo_252.png') @user = user @projects = projects mail(:to => user.email, :subject => "New Projects") end 回答1: I asume you already solved your question, I answer to help others: layout