skill-assessment-app/app/mailers/application_mailer.rb

21 lines
654 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2016-07-26 11:59:23 -05:00
class ApplicationMailer < ActionMailer::Base
2016-08-02 07:58:58 -05:00
default from: ENV['default_mail_from']
2016-07-26 11:59:23 -05:00
layout 'mailer'
before_action :inline_layout_images
private
def inline_layout_images
# inline images requested in default mailer layout
attachments.inline['perficientdigital-logo.jpg'] = image_file('perficientdigital-logo.jpg')
attachments.inline['yellowslant-left.jpg'] = image_file('yellowslant-left.jpg')
attachments.inline['yellowslant-right.jpg'] = image_file('yellowslant-right.jpg')
end
def image_file image
File.read(Rails.root.to_s + "/app/assets/images/#{image}")
end
2016-07-26 11:59:23 -05:00
end