osulyanov
5/3/2017 - 5:15 AM

application_mailer.rb

module EmailHelper
  def email_image_tag(image, **options)
    attachments[image] = File.read(Rails.root.join("app/assets/images/#{image}"))
    image_tag attachments[image].url, **options
  end
end
class ApplicationMailer < ActionMailer::Base
  default from: Setting.first.email_from
  add_template_helper(EmailHelper)
  layout 'mailer'
end