parent
a51a751524
commit
5ac9b530fe
@ -2,4 +2,19 @@
|
|||||||
class ApplicationMailer < ActionMailer::Base
|
class ApplicationMailer < ActionMailer::Base
|
||||||
default from: ENV['default_mail_from']
|
default from: ENV['default_mail_from']
|
||||||
layout 'mailer'
|
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
|
||||||
end
|
end
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
©2016 All Rights Reserved - Perficient Digital
|
©2016 All Rights Reserved - Perficient Digital
|
||||||
</td>
|
</td>
|
||||||
<td class="email-logo">
|
<td class="email-logo">
|
||||||
<%= image_tag("perficientdigital-logo.jpg", alt:"Perficient Digital") %>
|
<%= image_tag(attachments["perficientdigital-logo.jpg"].url, alt:"Perficient Digital") %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -37,13 +37,13 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:6px;">
|
<td style="width:6px;">
|
||||||
<%= image_tag("yellowslant-left.jpg", alt:"Perficient Digital") %>
|
<%= image_tag(attachments["yellowslant-left.jpg"].url, alt:"Perficient Digital") %>
|
||||||
</td>
|
</td>
|
||||||
<td class="email-bg" style="font-size:1px;">
|
<td class="email-bg" style="font-size:1px;">
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td style="width:6px;">
|
<td style="width:6px;">
|
||||||
<%= image_tag("yellowslant-right.jpg", alt:"Perficient Digital") %>
|
<%= image_tag(attachments["yellowslant-right.jpg"].url, alt:"Perficient Digital") %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user