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