I'd like to replace the default logo in my email templates ({$resourceBase}/i/civi99.png) with a URL that points to a different location where the custom logo won't be overwritten by updates. I can do that by directly editing the template to point to https://www.mydomain.com/images/logo.png for example, but I'd like to avoid asking customers to edit the templates, which requires programming skills. Instead, I'd like to tell them to put their logo in a magic folder where it will be picked up if it exists.
Probably [civicrm.files] would be a suitable location but I can't work out how to expand that in a smarty template.
I tried {crmSetting name="imageUploadURL" group="URL Preferences"} but that returns "[civicrm.files]/persist/contribute/" which doesn't expand the variable.
I also tried {crmResURL ext=civicrm} but that just gives "/wp-content/plugins/civicrm/civicrm/" which is not a complete URL and in any case points to a directory that will get overwritten by updates (yes I'm on WordPress).
I haven't yet found where $resourceBase is set but something equivalent that returns https://www.mydomain.com/wp-content/uploads/civicrm would be good. I think I can only create that new variable by writing an extension though, which is a lot of bother if there's a better way. I would have expected the root URL of the installation to be in the settings or global variables somewhere and accessible from smarty but I can't find it.
A possibly related problem is that I'd also like to retrieve information like the date of a contribution from the database and display that in an email. Again, I can see that information is put in a smarty variable in Invoice.php for example, but the format is wrong (American, comma in wrong place) and my hunch is the information should be accessible some other way through the API. But if so I can't find it.
I've spent several hours on this (even bought the book) and I'm still struggling to find any information on how to create or use variables like [civicrm.files] in general, and in smarty in particular. Can any one help with either a specific or a general solution?
Update: I've found a partial solution to the logo path problem. {$smarty.server.SERVER_NAME} will get the name of the "server", in a format like "www.mydomain.com". By sticking "https://" in front and "/wp-content/uploads/civicrm" at the end you can make a good guess at where civicrm.files is likely to be on a WordPress installation. But it's only a guess.