Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to export page content and send it in mail

Avatar

Level 3

Hi,

We have requirement to pull the content (complete page with all components/images configured on that page) from the page and send it through email.

Could you please let me know what is the best possible way to do this?

Thanks,

Hari

1 Accepted Solution

Avatar

Correct answer by
Level 10

If you want to email newsletters - you can look at:

http://docs.adobe.com/docs/en/cq/current/wcm/campaigns.html#Adding ExactTarget Email Tools to your email

On the other hand, if you want the ability to extract content from a given CQ page and email that - it more involved. 

All content in AEM is a JCR resource.

You can use the JCR API to read those resources. Content in pages is stored under /content -- as shown here:

[img]WOrkflow.png[/img]

HTML located on a page is just property of node. THat is - HTML like this:

<p><b>Geometrixx World Headquarters</b><br>
1234 Wilshire Blvd.<br>
Los Angeles, CA 90210<br>
USA</p>
<p><b>Geometrixx US East Coast</b><br>
10 Avery Street<br>
Boston, MA 02111<br>
USA</p>
<p><b>Geometrixx EMEA</b><br>
Barfuesserplatz 6<br>
4051 Basel<br>
Switzerland</p>
<p><b>Geometrixx APAC</b><br>
14 Temasek Blvd.<br>
Singapore</p>
<p> </p>

 

Is a text property that belongs to /content/geometrixx/en/toolbar/contacts/jcr:content/par/15_1204887676656. 

This property can be read via the JCR API. Therefore - read HTML using the JCR API and then place it into a collection - like an ArrayList.  

You can then dynamically create HTML that you want to email.  Dump all the content from the collection into the new HTML that you want to email. Use styles to make the email look the way you want it to look. 

You can place all this app logic into an AEM workflow. It may require developing some custom workflow step. If you do not know how to create a custom workflow step - see: 

https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

So this is not an out of the box feature - but it can be developed using AEM, the JCR API and custom workflow steps. 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

If you want to email newsletters - you can look at:

http://docs.adobe.com/docs/en/cq/current/wcm/campaigns.html#Adding ExactTarget Email Tools to your email

On the other hand, if you want the ability to extract content from a given CQ page and email that - it more involved. 

All content in AEM is a JCR resource.

You can use the JCR API to read those resources. Content in pages is stored under /content -- as shown here:

[img]WOrkflow.png[/img]

HTML located on a page is just property of node. THat is - HTML like this:

<p><b>Geometrixx World Headquarters</b><br>
1234 Wilshire Blvd.<br>
Los Angeles, CA 90210<br>
USA</p>
<p><b>Geometrixx US East Coast</b><br>
10 Avery Street<br>
Boston, MA 02111<br>
USA</p>
<p><b>Geometrixx EMEA</b><br>
Barfuesserplatz 6<br>
4051 Basel<br>
Switzerland</p>
<p><b>Geometrixx APAC</b><br>
14 Temasek Blvd.<br>
Singapore</p>
<p> </p>

 

Is a text property that belongs to /content/geometrixx/en/toolbar/contacts/jcr:content/par/15_1204887676656. 

This property can be read via the JCR API. Therefore - read HTML using the JCR API and then place it into a collection - like an ArrayList.  

You can then dynamically create HTML that you want to email.  Dump all the content from the collection into the new HTML that you want to email. Use styles to make the email look the way you want it to look. 

You can place all this app logic into an AEM workflow. It may require developing some custom workflow step. If you do not know how to create a custom workflow step - see: 

https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

So this is not an out of the box feature - but it can be developed using AEM, the JCR API and custom workflow steps.