Without looking carefully at the code, I’m 99% sure that the issue is on the Rails side and not the UX side, so I don’t think changing it on the Rails side is likely to fix anything. If you have a budget, I can help figure out how to do what you ask, but won’t promise that it will solve your problem.
You can find ones you’ve changed with something like this:
I don’t think the issue is on the rails side, since the UI wrongly lists the allowed tags (so that list is wrongly hardcoded somewhere) but %{base_url} is parsed just fine otherwise (see the thread), i.e. with rails i should be able to force save the value (bypassing any checks).
But all this is offtopic, really: my original question was just for a pointer on what rails object to target. If you can only offer paid help then I’ll wait hoping someone else is willing to offer some free help (I did that in other threads, also some github PRs). No hard feelings
Edit: You edited your post while I was typing. I’ll see how far I get with what you suggested (not sure how to adapt that for my specific example yet). TranslationOverride might be enough of a pointer
It was enough of a pointer, and I also found the bug (which is in the ruby code):
to=TranslationOverride.where(translation_key:"user_notifications.user_watching_category_or_tag.text_body_template").first
to.value="%{username} posted in \"[%{topic_title}](%{base_url}%{url})\"\n\n--"
to.save!
ActiveRecord::RecordInvalid: Validation failed: The following interpolation key is invalid: base_url
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/validations.rb:80:in `raise_validation_error'
validations.rb is the culprit … base_url is valid, and does get parsed just fine (as I explained in the linked thread). It seems I either need to hack validations.rb (ugh!) or edit the SQL database directly (which is what I had after the upgrade) … so now I need to find where in the postgre database these template tags live
p.s. It’s such an easy and quick fix though for the devs (I could do a PR but I only know a subset of tags where %{base_url} is missing from the valid tags)