adobe/aem-core-email-components

Review Link Handling with AC markup

buuhuu opened this issue · 1 comments

Links created by the RTE Link Plugin or ordinary Links of Components like the teaser may contain AC markup. In order to pass this markup as-is to Adobe Campaign some mechanism like XSS and Link sanitisation need to be bypassed.

Current Solution:

  • The HrefProcessor is used to decode the urls encoded by the RTE Link Plugin in rich texts (text, teaser)
  • The AccUrlProcessor is used to decode the urls sanitised by the DefaultPathProcessor (teaser)

In both cases the processing is applied in the Component model which means, for customers building custom components both classes would need to be available as public API.

Product Solution:

  • AEM provides a LinkTransformer (in the mcm core) which handles AC specific links but not when (shouldRewriteLink()) the entire link is AC markup (only when for example the fragment contains ac markup)

Using a central mechanism for link handling could involve implementing:

  • a email specific PathProcessor that masks the AC expressions before delegating to the DefaultPathProcessor. This would already address all the issues for component links (title, button, teaser, image)
  • a global, email specific Transformer for RTE links that (a) externalises links using the same approach as the PathProcessor mentioned before and (b) marks them to be skipped by the linkchecker

(b) is in particular necessary as in the editor the campaign specific rewriter pipeline is not activate (by resource type). It is however used in the campaign content servlet.

Implementing that makes a lot of the models obsolete as they often just contain additional logic to handle links.