systopia / CiviProxy

A security proxy for CiviCRM
GNU Affero General Public License v3.0
7 stars 18 forks source link

Mend URLs for additional Mosaico Templates #37

Closed pbatroff closed 4 years ago

pbatroff commented 4 years ago

Mend URLs fails when the template is in the [civicrm-files]/mosaico_tpl are used, and static images from the template are created/referenced.

This is an example URL:

https://__BASE_URL__/sites/default/files/civicrm/mosaico_tpl/versafix-1.1/img/icons/fb-bw-96.png

The problem is, that in the template this is a relative path, and this will be fixed by CRM_Mosaico_UrlFilter::filterHtml.

It has to be determined if that is before we alter content in the alterMailer hook or after. if it is after, we have to double check and verify that the URL is correct.

pbatroff commented 4 years ago

The easiest way to achieve this is to move the mosaico_tpl folder to [civicrm-files]/persist/mosaico_tpl, then it is fully supported by CiviProxy.

It gets problematic with already created templates. The URLs there need to be either manually changed before moving the template folder, or the old folder must stay there, and the social icon block needs to be replaced, and the template saved anew. (haven't tested this yet).