cancel
Showing results for 
Search instead for 
Did you mean: 

edit email template wf-email.html.ftl to link to share content instead of download link

pwjepson
Champ in-the-making
Champ in-the-making
Hi,

the default wf-email.html.ftl will provide a download link to the content added to a workflow. I would prefer to provide a link to the content in share instead.

Is there a simple line of code that i can replace?
8 REPLIES 8

jpotts
World-Class Innovator
World-Class Innovator
In Share there are two ways you can get to a document. One is through the Repository and the other is through Sites (assuming the document is in a site). The URL to get to the document details for a document that is in a site looks like this:

http://localhost:8080/share/page/site/test-site-1/document-details?nodeRef=workspace://SpacesStore/f...

Note the site ID, which in my example is "test-site-1". There may not be a quick way from the template to know if a document is in a site or not, and if it is, what is its site ID.

When a document is not in a site, its URL looks like this:

http://localhost:8080/share/page/document-details?nodeRef=workspace://SpacesStore/f70e2505-5002-42b7...

In that particular email template, the place you'd want to change the URL is right here:


    <td>
        <a href="${shareUrl}/proxy/alfresco/api/node/content/workspace/SpacesStore/${doc.id}/${doc.name}?a=true">
        ${shareUrl}/proxy/alfresco/api/node/content/workspace/SpacesStore/${doc.id}/${doc.name}?a=true</a>
    </td>


So if all of your documents are always in the repository and never in Share sites, you can use the share/page/document-details URL here. If all of your documents are always in a Share site and never in the repository, you can use the share/page/site URL but you'll have to figure out what the site ID is.

If your workflows run with documents that are sometimes in sites and sometimes not, you'll have to do something different. Maybe you could write a web script that would take the nodeRef as an argument, figure out if it was in a site or not, and then redirect to the appropriate URL.

Just an idea. Others may have better ones.

Jeff

pwjepson
Champ in-the-making
Champ in-the-making
Thanks Jeff,

the coding to get the link was beyond me unfortunately, so i went with this work around. I removed the download link completely and just displayed the link to the task which was generated automatically in the email template already.

pwjepson _

i am also having a trouble making the link available on the email template. can you share your workaround here.

thanks

Hey tushar Khanka‌ - I'm not sure pwjepson _ has been back to the community since we moved to this platform. Did you try the workaround they suggested (removed the download link completely and just displayed the link to the task which was generated automatically in the email template already)

All I did was remove the section of code that displayed the download link. then the only option for the user was to open the task. it worked out better for us since we wanted to keep the users in their tasks and within the workflows.

Welcome back

Although I'm thinking you have 2 accounts? Are you  as well?

jepsontech
Champ in-the-making
Champ in-the-making

Yes! I may be under jepsontech as well.

Sent from my Verizon, Samsung Galaxy smartphone

You are. I'll PM you.