if Rails.const_defined?("MandrillMailer") && Rails.application.config.action_mailer[:delivery_method] == :letter_opener
MandrillMailer::TemplateMailer.class_eval do
define_method :deliver do
opts = {
from: message['from_email'],
to: message['to'].map{|m| m['email']}.join(', '),
subject: message['subject'],
body: JSON.pretty_generate(message)
}
ActionMailer::Base.mail(opts).deliver
end
end
end
here is integration:
in initializers
if you want, i can make PR with integration