[英]Serving assets for mailer from S3
I have an email template which requires image, I decided to serve it through S3 bucket. 我有一个需要图像的电子邮件模板,我决定通过S3存储桶提供该模板。
In template: 在模板中:
<%= image_tag 'logo.png' %>
application.rb: application.rb:
config.action_mailer.asset_host = "https://s3.mybucket.com"
But after template is rendered I get url like this: 但是在渲染模板后,我得到如下URL:
" https://s3.mybucket.com/logo-1ee47e184c8a345a78d06117ad1b04f560256a5002ad5c5b798c41b1a.png " “ https://s3.mybucket.com/logo-1ee47e184c8a345a78d06117ad1b04f560256a5002ad5c5b798c41b1a.png ”
Am I missing some steps here? 我在这里错过了一些步骤吗?
试试看:
<%= image_tag '/assets/logo.png' %>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.