-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{{ base_url }} doesn't work in email templates #217
Comments
@greyskin thanks for bringing this topic up. First of all,
We do have an "issue" with My recommendation is to write something like this in email page templates:
Regarding assets, I declare my css like this:
|
Thanks @did, That's very useful information. I've implemented your suggestion and it works as expected. For others who might stumble across this, one thing to note is that
Then:
|
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:
{{ base_url }}{% path_to 'contact' %}
will render http:///contact{{ base_url }}{% path_to 'contact' %}
will render http:///_app/site-slug/preview/contactI'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?
The text was updated successfully, but these errors were encountered: