Workflow Email Notification pointing to wrong url | Community
Skip to main content
Level 3
Sep 26, 2018 4:50 PM UTC
Solved

Workflow Email Notification pointing to wrong url

We recently migrated to AEM 6.4 and noticed all OOB workflow Email notification body content which also has URL mentioned pointing to local-host URL on all environments (dev,stage, prod)

This was working on prior AEM version we were on (6.1) and We do have OSGI Link Externalizer Config properly setup for all run modes on 6.4

Apart from externalizer, We do have   Day CQ Workflow Email Notification Service (com.day.cq.workflow.impl.email.EMailNotificationService) configured with correct values for Dev/stage/prod but its also not helping.

Can anyone tell if its a product bug or required additional configuration ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Sep 26, 2018 7:46 PM UTC

Our support team replied:

Ok, so when I tested with Externalizer then the setting is ignored. Whenever I use Host URL Prefix from Host URL Prefix

It changes the prefix.

Might a good idea to log a support case

25 replies

gaurav_s_tadigi
New Participant
Jun 5, 2020 3:47 AM UTC

@anujpathak Were you able to resolve this bug with OOTB Workflow template not honoring the externalizer domain mapping? We are implementing this for one of the projects and need no customization of templates and unfortunately it doesn't work fine even in AEM 6.5.4. 

 

Any pointers would be helpful!

Translate
chintan97
Level 2
Jun 5, 2020 8:46 PM UTC
Did you try updating local to map to author URL? I tried that it started pointing to correct URL
Translate
chintan97
Level 2
May 20, 2020 6:44 PM UTC

What's use of 'local' in Domains? I updated local URL from localhost to author-dev and the email have that URL. Will it break something?

 

cc. @smacdonald2008 

Translate
smacdonald2008
Level 10
Sep 27, 2018 7:30 PM UTC

It was closed because a customer support agent asked you open a ticket. They said they saw an issue. Once we get confirmation from support- we typically close the thread. There is nothing more we can do here - this is a bug. Did you log a ticket?

Translate
Level 3
Sep 27, 2018 7:18 PM UTC

I dont understand why this thread was marked Answered though its pending further investigation by support or original issue for which this question was created does not resolved yet.

Translate
Level 3
Sep 26, 2018 10:21 PM UTC

got it thanks

Translate
smacdonald2008
Level 10
Sep 26, 2018 10:15 PM UTC

There is a bug ( when trying to use it within an email template) as customer support stated.

This article is for ppl whom want to know how to build a solution with this API and see it running.

When we were investigating this - i saw we had no HELPX Quick Start for this API - that is and end to end to quickly get it working.

Translate
Level 3
Sep 26, 2018 9:59 PM UTC

ok i saw this before but it does not answer my question why OOB email template host.prefix variable does not have correct value.

Can you check with your team on this since its Adobe OOB email and back end class who call this template to trigger email.

this will help me understand how $ {host.Prefix} variable value is calculated and passed to this template then we can figure out which configuration is actually responsible for host.Prefix wrong value

Translate
smacdonald2008
Level 10
Sep 26, 2018 9:48 PM UTC

Here is a HELXP that shows using this API in a Java class --

Adobe Experience Manager Help | Creating an Adobe Experience Manager 6.4 custom workflow step that uses the Externalizer…

There is a video too in this HELPX that shows this API working.

Translate
Level 3
Sep 26, 2018 8:32 PM UTC

I agree, it work for me in Java or If I generate URL value using externalizer API in Java class and use it in email template as variable.

But, it does not work for OOB workflow email template at location /libs/settings/workflow/notification/email/default/en.txt

where its using $ {host.Prefix} for URL.

For me its product issue since its only with OOB emails.

Do you know or can you check how $ {host.Prefix} variable value is calculated and passed to this template then we can figure out which configuration is actually responsible for host.Prefix wrong value

F

Translate
smacdonald2008
Level 10
Sep 26, 2018 8:11 PM UTC

Got it working too in Java --

public void execute(WorkItem item, WorkflowSession wfsession,MetaDataMap args) throws WorkflowException {

    

    try

    {

        log.info("Here in execute method");    //ensure that the execute method is invoked   

              

        ResourceResolver resourceResolver = resolverFactory.getAdministrativeResourceResolver(null);

       

       

        //Get the FULL URL OF THE PAYLOAD in the workflow

        //Get the Assets from the file system for a test

        WorkflowNode myNode = item.getNode();

         

        String myTitle = myNode.getTitle(); //returns the title of the workflow step

         

        log.info("**** The title is "+myTitle); 

         

        WorkflowData workflowData = item.getWorkflowData(); //gain access to the payload data

        String path = workflowData.getPayload().toString();//Get the path of the asset

       

        //GET FULL PATH

        String myExternalizedUrl = externalizer.publishLink(resourceResolver, path) + ".html";

       

        log.info("The FULL PATH FO THE PAY LOAD IS "+ myExternalizedUrl); 

       

       

       

    }

      

        catch (Exception e)

        {

        e.printStackTrace()  ;

        }

     }

Translate