2016-09-08 10:25:33 -05:00
|
|
|
# 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'
|
2016-09-16 12:57:24 -05:00
|
|
|
|
|
|
|
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
|