cancel
Showing results for 
Search instead for 
Did you mean: 

Email Templates in 4.0B Not working

shairozan
Champ in-the-making
Champ in-the-making
Hello everyone,

I've run across an odd problem that I'm not remotely sure how to solve. When previously running Alfresco 3.3, I didn't have an issue with this, but here's what's happening:

In a given space in Alfresco Explorer, I can create a content rule specifying whenever an object is added, send an email. Whenever I use a plain text email, the email gets sent without any issue. When I specify to use any of the canned notification templates, however, the message never gets sent and the following appears in alfresco.log

13:21:35,830 ERROR [freemarker.runtime] Template processing error: "get(shareUrl) failed on instance of org.alfresco.repo.template.TemplateNode"
Caused by: org.alfresco.error.AlfrescoRuntimeException: 10100042 A transaction has not be started for method 'getSite' on org.alfresco.service.cmr.site.SiteService
Caused by: org.alfresco.error.AlfrescoRuntimeException: 10100042 A transaction has not be started for method 'getSite' on org.alfresco.service.cmr.site.SiteService
org.alfresco.error.AlfrescoRuntimeException: 10100044 Failed to send email to:[email.address]

email.address being the actual email.address of the assigned user. Does anyone have a clue as to how to resolve this? Without this being fixed I won't be able to use any templates.
2 REPLIES 2

cnareshreddy
Champ in-the-making
Champ in-the-making
Hi shairozan,
      Actually there might be a problem with shareUrl which is not able resolve at runtime, due that an exception was thrown.
Remove that url give your ip instead as mentioned below.YOu can create this template in document library space(email templates)
 
<#– Sends email to people when a document is added to a given space –>

Hello sir,
       A document titled '${document.name}' is Uploded or Created in
the '${space.name}' space  by '${person.properties.firstName}<#if person.properties.lastName?exists>
${person.properties.lastName}</#if>'on ${date?datetime?string.full}.

You can view it through this link:
http://<ur ip>:8080/alfresco${document.url}

Please review it as soon as possible.
Best Regards
<your organization details>

I had tested this which is working with out any issues.you can add more parameters if you want

syanzy
Champ in-the-making
Champ in-the-making
Several problems with this approach:
- The link points directly to the file for download (or browser view if the file type is supported by the browser).
- The user will be prompted to login to the old alfresco interface rather than the new share interface, which is confusing for users.
- The users will have to login separately into share interface in order to perform actions on the document, e.g., move the file.

Alternatively, you can hardcode part of the resulting URL and use the other document properties:
${document.storeId}
${document.id}
${document.siteShortName}
So that you have:
http://[youralfrescodomain]/share/page/site/${document.siteShortName}/document-details?nodeRef=works...}