I'm sending html emails through an email action program and something weird: an inline image appears on an email sent from a production deployment, but not from a local development.
professionnel_mailer.rb
class ProfessionnelMailer < ApplicationMailer
layout 'professionnelmailer'
def notification(professionnel)
attachments.inline['image200.png'] = File.read("#{Rails.root}/app/assets/images/image200.png")
@professionnel = professionnel
mail(to: @professionnel.email, subject: "You have received a notification !")
end
end
notification.html.erb
<%= image_tag(attachments['image200.png'].url)%>
<h1>Hello <%= @professionnel.first_name %> !</h1>
Of course, image200.png is present locally and remotely. And the letter was received in both cases, then my Amazon AWS SES setup is correct in both environments .. Not really sure where it breaks ..
source
share