adobe / aem-core-email-components

Apache License 2.0
13 stars 11 forks source link

cannot link AEM content in ACS #257

Open knennigtri opened 1 year ago

knennigtri commented 1 year ago

I have AEM linked to ACS and an old email campaign with the legacy components can link with ACS just fine. When I try and link a new email campaign using these core email components, I'm getting a 'Response is not valid JSON'. From what I can tell, ACS is looking for a response of content/campaigns/brand/master/emails/myemail.campaign.content.json and when I try this request on author (or publish) I get the same error as below. I thought this was because of https://github.com/adobe/aem-core-email-components/blob/main/examples/ui.apps/src/content/jcr_root/apps/core-email-components-examples/config/rewriter/email-link-rewrite/.content.xml but after implementing this for my project, it still wouldn't work. Any tips would be massively helpful. Thanks.

Response is not a valid JSON:
<h1>Error during include of component '/apps/wetrain/components/email/page'</h1><h3>Error Message:</h3>
<pre>java.lang.NullPointerException: no mapping for html</pre><h3>Processing Info:</h3>
<table style='font-family: monospace'>
<tr><td>Page</td><td>=</td><td>/content/campaigns/wetrain/master/campaign-emails/training-email<td></tr><tr><td>Resource Path</td><td>=</td><td>/content/campaigns/wetrain/master/campaign-emails/training-email/jcr:content<td></tr><tr><td>Cell</td><td>=</td><td>page<td></tr><tr><td>Cell Search Path</td><td>=</td><td>page|basicpage<td></tr><tr><td>Component Path</td><td>=</td><td>/apps/wetrain/components/email/page<td></tr></table>
<h3>Sling Request Progress:</h3>
<pre>
      0 TIMER_START{Request Processing}
      1 COMMENT timer_end format is {&lt;elapsed microseconds&gt;,&lt;timer name&gt;} &lt;optional message&gt;
      4 LOG Method=POST, PathInfo=null
      5 TIMER_START{handleSecurity}
   1358 TIMER_END{1351,handleSecurity} authenticator org.apache.sling.auth.core.impl.SlingAuthenticator@54d6f62f returns true
   1537 TIMER_START{ResourceResolution}
   2486 TIMER_END{947,ResourceResolution} URI=/content/campaigns/wetrain/master/campaign-emails/training-email.campaign.content.json resolves to Resource=JcrNodeResource, type=cq:Page, superType=null, path=/content/campaigns/wetrain/master/campaign-emails/training-email
   2491 LOG Resource Path Info: SlingRequestPathInfo: path=&#39;/content/campaigns/wetrain/master/campaign-emails/training-email&#39;, selectorString=&#39;campaign.content&#39;, extension=&#39;json&#39;, suffix=&#39;null&#39;
   2492 TIMER_START{ServletResolution}
   2495 TIMER_START{resolveServlet(/content/campaigns/wetrain/master/campaign-emails/training-email)}
   2504 TIMER_END{8,resolveServlet(/content/campaigns/wetrain/master/campaign-emails/training-email)} Using servlet /libs/cq/Page/campaign/content.json.POST.jsp
   2507 TIMER_END{14,ServletResolution} URI=/content/campaigns/wetrain/master/campaign-emails/training-email.campaign.content.json handled by Servlet=/libs/cq/Page/campaign/content.json.POST.jsp
   2509 LOG Applying Requestfilters
bpauli commented 1 year ago

Hi @knennigtri, when you try to debug this error with a post request to your campaign page you have to provide the delivery parameter (for example delivery http://localhost:4502/content/campaigns/wetrain/master/campaign-emails/training-email.campaign.content.json?delivery=DM43. Can you please test this again and check the json output? Thanks!

vasu1412 commented 9 months ago

Hi @knennigtri , were you able to solve this issue.

Hi @bpauli , I used delivery=DM.. in my postman call. I am getting response with html when I use admin credential while testing the postman call. If I use campaign-remote user to make the same api call I end up in the same error, when I try to connect the email created using these email component I do see same error.

java.lang.NullPointerException: no mapping for html

Processing Info:

Thanks Dev