Skip to content

{{ base_url }} doesn't work in email templates #217

@greyskin

Description

@greyskin

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:

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions