cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying e-mail Notification URL ?

goozey
Champ in-the-making
Champ in-the-making
I have alfresco 4.2.e Community edition installed on my Debian test environment server. I have a domainname designated for the server and currently using a reverse proxy via Nginx to enable SSL (https://) using the following settings within nginx:

server {
        listen 443;
        server_name alfresco.companyname.com;
        ssl                     on;
        ssl_certificate         /etc/ssl/certs/alfresco.companyname.com.crt;
        ssl_certificate_key     /etc/ssl/private/alfresco.companyname.com.key;
        rewrite ^/$ /share;

        location / {
        root /opt/alfresco-4.2.e/tomcat/webapps/share/;
        proxy_pass https://localhost:8443;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header host $host;
        proxy_set_header X-Forwarded-Server $host;
        }
        }


Basically i want users to be able to access the site internally and externally which is working fine so far, all they have to do is type in alfresco.company.com into the url bar of their browser.

Now the problem:
When i start a workflow and check the email notification checkbox it sends out an email (as intended) but the link is… not optimal, this is what i am receiving:

https://alfresco.companyname.com:8080/share/page/task-edit?taskId=activiti$245

This is obviously somewhat breaking things. Is there any way on how I could remove the ":8080" from the url?
I have checked the forums and some suggestions have been to edit the email notifications code itself which would be this part within the wf-email_de.html.ftl file if i am not mistaken:


<#if args.workflowPooled == true>
                                                <p>Klicken Sie auf diesen Link um die Aufgabe einzusehen:</p>
                                                <p><a href="${shareUrl}/page/task-details?taskId=${args.workflowId}">${shareUrl}/page/task-details?taskId=${args.workflowId}</a>
                                             <#else>
                                                <p>Klicken Sie auf diesen Link um die Aufgabe zu ändern:</p>
                                                <p><a href="${shareUrl}/page/task-edit?taskId=${args.workflowId}">${shareUrl}/page/task-edit?taskId=${args.workflowId}</a>
                                             </#if>


What i do not understand is where the ${shareUrl} value is defined/set and where i coudl edit this so the ":8080" is removed.
I welcome any and all suggestions.

Kind regards,
Alex
11 REPLIES 11

niketapatel
Star Contributor
Star Contributor
Hi, This URL is being generated from properties that are defined in your- alfresco-global.properties

You can change below properties as per your requirement and accordingly URL will be generated.

alfresco.context=alfresco
alfresco.host=my.host.com
alfresco.port=8080
alfresco.protocol=http

share.context=share
share.host=my.host.com
share.port=8080
share.protocol=http

If you need to understand detail code then, Please check below code

1)MailActionExecuter is responsible to send Share email notification
2)And this class process FTL template and gets URL from SysAdminParams and which basically refers above properties.

Hope it helps!

goozey
Champ in-the-making
Champ in-the-making
Nikita,

I am not quite sure if you understand what exactly it is that i need here. I tried changing the alfresco-global.properties sections you mentioned in your post, but unfortunately doing that kind of breaks everything, especially considering that i am using nginx as the webfrontend and reverse proxy for SSL.

This is what i have currently in my global properties file and this works perfectly:

dir.root=/opt/alfresco-4.2.e/alf_data

alfresco.context=alfresco
alfresco.host=alfresco.companyname.com
alfresco.port=8080
alfresco.protocol=http

share.context=share
share.host=alfresco.companyname.com
share.port=8080
share.protocol=https


If i remove the share.port=8080 and share.protocol=https from the list then emails and the system will continue to work, but when i start a workflow and send email notifications via workflows the address i will be receiving is this:

http://alfresco.companyname.com:8080/share/page/task-edit?taskId=activiti$845

This address technically speaking works, but i want to get rid of the :8080 within the link… any suggestions?

EDIT:
If there is no simple way to do this then I think i may just go the route of hardcoding/tailoring the email template link prefixes… was looking for a more elegant solution though

goozey
Champ in-the-making
Champ in-the-making
Since there has not been any other suggestions or recommendations on how to solve this I have decided to edit the email template itself since messing with the proposed settings breaks the system.

eswbitto
Confirmed Champ
Confirmed Champ
This is what I am using. We're on Centos with Apache doing the front end SSL.

httpd.conf


<VirtualHost *:443>
  ServerName fqdn.net
 
  SSLEngine on
  SSLCertificateKeyFile to/some/filepath/file.key
  SSLCertificateFile to/some/filepath/file.crt
  SSLCACertificateFile to/some/filepath/file.crt

 
  RequestHeader set X-Forwarded-Proto "https"
  ProxyPass / http://fqdn.net:8080/
  ProxyPassReverse / http://fqdn.net:8080/


  ProxyTimeout 300
  SSLProxyEngine on

  <Proxy *>
    allow from all
  </Proxy>

</VirtualHost>



Not sure if that helps or not, but maybe you can draw and idea from it. Hope it helps.

goozey
Champ in-the-making
Champ in-the-making
ESWBitto,

While i appreciate your comment and it might be helpful for people who use apache, I have the reverse SSL proxy working perfectly fine on alfresco right now. There are zero issues with it.

The main problem I am having is that whenever you start a workflow and check the email notification box for that workflow you will receive an email(for that workflow) which still has the ":8080" inside the link, i want that :8080 removed from the email.

eswbitto
Confirmed Champ
Confirmed Champ
Hmm… Ok try looking at the email templates

http://yourfqdn.net/alfresco

login as admin…

Company Home/Data Dictionary/Email Templates. From here you can modify what you want. Hope it helps.

Edit…

Have you looked at this file?
tomcat/webapps/share/WEB-INF/classes/alfresco/share-config.xml

2nd Edit…
Your issue sparked interest in something that I had put back on hold to come back to later. I've done about three different workflows and the link that I get is this.

https://fqdn/share/proxy/alfresco/api/node/content/workspace/SpacesStore/678ca124-014d-4165-9bef-9ef...

in the alfresco-global properties I've set the port to 443 on share.

I've also edited tomcat/shared/classes/alfresco/web-extension/share-config-custome.xml

I could post a copy if you want to take a look.

This is pretty much the only thing I can think of that would help you with your issue. I haven't modified any files below the WEB-INF directory.

goozey
Champ in-the-making
Champ in-the-making
ESWBitto,

I have marked your comment as helpful and useful, since it actually is. Yes i would love to see your modified files (take a look at it) whenever you find some time to copy paste them into here Smiley Happy

eswbitto
Confirmed Champ
Confirmed Champ
I have changed my domain name to FQDN. Hope this helps.

danielmachado77
Champ in-the-making
Champ in-the-making

Same problem here, I have a Nginx as a reverse proxy e the e-mails from activity came with the Alfresco port and not with Nginx port. Some news about this problem?