-
Notifications
You must be signed in to change notification settings - Fork 11
E Mail Link Transfomer
When an e-mail is delivered to a recipient, externalisation of links and references to other assets is usually required. The Core E-Mail Components ship a E-Mail Link Transformer implementation to handle this in a common way.
The transformer implementation needs to be enabled in the Apache Sling rewriter pipeline that handles e-mail pages in the page editor and when the e-mail is exported.
In the examples there is a configuration, which should be work as default for the majority of cases.
The E-Mail Link Transformer handles the following elements and attributes:
a#href
-
img#src
,img#srcset
td#background
th#background
It uses the LinkManager
API of the Core WCM Components to generate a link and returns either the mapped or the externalised url, according to whether the former returns an absolute url or not.
In older versions of AEM (older than AEM 6.5 SP16 or AEM as a Cloud Service 9398) the servlet which exports the content of an e-mail to Adobe Campaign Standard and Classic, required the default campaign-link-write
transformer to be configured for the rewriter pipeline. For this version we recommend to configure both, the email-link-rewrite
and campaign-link-rewrite
. This way the E-Mail Link Transformer will rewrite and externalise the links and other references, while the campagin-link-rewrite
transformer ignores them.
The only exception are anchor links which will be ignored by the E-Mail Link Transformer but not the campaign-link-rewrite
transformer. This will be fixed in newer versions of AEM, which do not require the campaign-link-rewrite
transformer to be present in the pipeline configuration anymore.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
contentTypes="[text/html]"
enabled="{Boolean}true"
generatorType="htmlparser"
order="1001"
paths="[/content/core-email-components-examples,/content/campaigns/core-email-components-examples,/content/experience-fragments/core-email-components-examples,/content/campaigns/core_email_component_brand]"
serializerType="htmlwriter"
transformerTypes="[email-link-rewrite,campaign-link-rewrite]">
<transformer-email-link-rewrite
jcr:primaryType="nt:unstructured"
component-optional="{Boolean}true"
cq:contentType="campaignContent"/>
<transformer-campaign-link-rewrite
jcr:primaryType="nt:unstructured"
component-optional="{Boolean}true"/>
<generator-htmlparser
jcr:primaryType="nt:unstructured"
includeTags="[IMG,A,TD,TH]"/>
</jcr:root>