Email notification template GUI complains about %{base_url}

But it does work, i.e. %{base_url} is expanded just fine, so it’s not invalid (it’s just the GUI that complains). Moreover, one cannot create a fully working link without it (unless they hardcode the full base URL, which is a no no)

The purpose of placeholders in general is to make robust software, which includes avoiding hard coding things. If I change the domain name, host name, or path to my Discourse installation (any element of base_url) then I’d have to edit all the templates where I hardcoded it. That’s bad coding practice.

Since I know Discourse development otherwise follows very healthy and robust coding practices, I can only assume it was an oversight/bug to (1) remove base_url when validating the template but (2) actually still interpret if it’s present, and (3) not offer an alternative to build a fully working url without resorting to bad coding practices…

Also, this would be a big backwards incompatible change for which I see no actual benefit, but does cause a lot of manual work for users … more of a reason to assume it’s a bug/oversight.

(I’ve also seen other bugs introduced in 3.x related to text templates, so even more of a reason to assume it was an oversight)

1 Like