All images in emails (invites, confirmation, transactions, etc) are built with a broken path. All lack the domain name.
Sharetribe Version:
Environment:
Ubuntu 20.04
Node v10.15.3
NPM 6.4.1
Server mode:
Production
Description:
I’m getting paths like /system/wide_logos/1/header/logo-01.png?1593402420
in the src. Naturally, these images are broken since there’s no domain.
There’s a thread about this exact problem on the community forum.
This solution is dated (three years old), so I’m not sure if the _communitylisting-update-v2.html.haml
existed at that time. I am using the new layouts, so that’s one place where I’ll likely be hardcoding my domain. The problems I have with this approach are that there are many diverse areas in which I’ll need to add a domain and that it’s clearly not intended to be this way. I’m hoping I’m missing something obvious.
Steps To Reproduce:
New install of ShareTribe
:local asset configuration
asset_host: mydomain.com (blank also fails to produce image paths)
Successful smtp and sendmail email set-ups (emails are sent and received without errors)
Additional information
I attempted manually adding my domain to the domains and community tables of the database. It corrected some links which were pointing toward the default subdomain installation but did not add the domain to file paths.
I looked at some of these email .yml’s, finding that there’s no special treatment to add the domain name. I’m not deeply familiar with Ruby on Rails, but it doesn’t seem like img_tag() has any post-processing for the src that adds the domain name. The img_tag for the logo in the email headers, for example, looks like this in app/views/email_design/email.html.haml
:
= image_tag('logos/full/default.png', alt: community.full_name(I18n.locale), style: 'margin: 0 auto;')
I can understand how these paths are adequate for local assets, but how does this work for remote assets or emailed images? Since I’m the first to have this problem here, there’s clearly something I’m missing.