I have a Rails 4 application that sends some HTML emails. Letters contain an image in the footer, but it’s hard for me to find it in the workplace. I looked through stackoverflow for a few answers on this, and everyone says
1 - add config.action_mailer.asset_host = "http://example.com"
2 - use a helper method image_tagfor rendering images
So i did it
...
config.action_mailer.asset_host = "http://example.com"
...
<%= image_tag "dark/footer.png", style: "border: 0;", alt: "footer" %>
However, the generated src tag does not take into account the digest sent to the image name as soon as I preassemble the assets.
In my letter I get src="http://example.com/assets/dark/footer.png"
and in my application I have public/assets/dark/footer-e2f622dcfd3016d12ec655bcfe81ec3d.png
therefore, the image is not displayed properly.
Am I missing something here?
Thank.