config.parent_mailer = 'ApplicationMailer'
class ApplicationMailer < ActionMailer::Base
before_action :add_inline_attachment!
private
def add_inline_attachment!
attachments.inline['logo.png'] = File.read(
Rails.root.join('app', 'assets', 'images', 'your_logo.png')
)
end
end
= image_tag attachments['logo.png'].url
Comments