-
Notifications
You must be signed in to change notification settings - Fork 60
Description
On a number of sites we manage, we have set up various email templates to be delivered to our clients' customers when they perform certain actions on the site, e.g. register for an account, place an order, etc.
We have been using {{ base_url }} in conjunction with the {% path_to 'page-handle' %} tag in our email templates and we have realised that this doesn't work as we expected. Specifically, it only renders the relative page link.
Example:
- On a live domain
{{ base_url }}{% path_to 'contact' %}will render http:///contact - or, if the email is triggered while on the staging domain, e.g. https://station.locomotive.works/_app/site-slug/preview/page-slug,
{{ base_url }}{% path_to 'contact' %}will render http:///_app/site-slug/preview/contact
I've done some testing and have removed {{ base_url }} entirely and the result is the same. I expect our email client (Gmail) is adding the URL protocol (http://) automatically, which would indicate that {{ base_url }} isn't being rendered at all.
Obviously, we can hard-code the URL protocol and site domain for every site, but this is far from ideal. Is this expected behaviour?