<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Use Custom Email Template 4 Sending Email from Share? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247620#M200750</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;what do you think about the following solution:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Create the custom email action which will allow you to pass an email template as parameters. In this acction you will use the Template Service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Use the code like this to process the passed template: &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;text = templateService.processTemplate("freemarker", templateRef.toString(), model);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;3. Create a webscript which you will call from Share, which will call the custom email action.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pawel Rzeszowski.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jan 2012 12:40:35 GMT</pubDate>
    <dc:creator>pawel_rzeszowsk</dc:creator>
    <dc:date>2012-01-06T12:40:35Z</dc:date>
    <item>
      <title>How to Use Custom Email Template 4 Sending Email from Share?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247619#M200749</link>
      <description>Dear Folks,I am new to Email Templates. I know Alfresco's default Email Templates are at Company Home/Data Dictionary/Email template space.  Now I want to create custom email template which is nothing but simple FTL file (Which I can do) but the problem or issue I am facing is how to use that templa</description>
      <pubDate>Wed, 04 Jan 2012 12:38:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247619#M200749</guid>
      <dc:creator>nirvanvjain</dc:creator>
      <dc:date>2012-01-04T12:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Custom Email Template 4 Sending Email from Share?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247620#M200750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;what do you think about the following solution:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Create the custom email action which will allow you to pass an email template as parameters. In this acction you will use the Template Service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Use the code like this to process the passed template: &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;text = templateService.processTemplate("freemarker", templateRef.toString(), model);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;3. Create a webscript which you will call from Share, which will call the custom email action.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pawel Rzeszowski.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 12:40:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247620#M200750</guid>
      <dc:creator>pawel_rzeszowsk</dc:creator>
      <dc:date>2012-01-06T12:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Custom Email Template 4 Sending Email from Share?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247621#M200751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear pawel_rzeszowski,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a billion for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just correct me if I am wrong,From your reply What I understood is I have to write one Java Class and made its entry in ……-context.xml and that class I have to call from share webscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The position where I get stuck is , as of now I am sending static mail with document name to the user in my DATA WEBSCRIPT with this code &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mail = actions.create("mail");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mail.parameters.to = "emailID";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var document_name= node.properties["cm:name"]; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mail.parameters.subject = loggedinuser+" has recommended "+document_name;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var text= loggedinuser+" has recommended "+document_name+" document to you";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text += "\n"+"Comment provided:::"+comment;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mail.parameters.text = text;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;logger.log("Body is "+mail.parameters.text);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mail.execute(companyhome);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;But now I have to send it with Email Template like notify-email.ftl (of share which is the template for invite user on site). I checked that code but unable to understand and in that code invite user name is not passed to the template but I want to pass document name to the template, Please guide me how to do that ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also how to call java class from share (presentation webscript) —&amp;gt; datawebscript(Which calls javaclass for email sending) —&amp;gt; javaclass (which I have to call for email sending with custom email template) ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please guide me.&amp;nbsp; Any help in this matter by any body is highly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Nirvan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 13:35:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247621#M200751</guid>
      <dc:creator>nirvanvjain</dc:creator>
      <dc:date>2012-01-06T13:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Custom Email Template 4 Sending Email from Share?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247622#M200752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello nirvanvjain,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;But now I have to send it with Email Template like notify-email.ftl (of share which is the template for invite user on site). I checked that code but unable to understand and in that code invite user name is not passed to the template but I want to pass document name to the template, Please guide me how to do that ?&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;You can pass the email template as the parameter in your custom email action.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Also how to call java class from share (presentation webscript) —&amp;gt; datawebscript(Which calls javaclass for email sending) —&amp;gt; javaclass (which I have to call for email sending with custom email template) ?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;You can call the datawebscript from theShare client. In the datawebscript you will call the custom java action. You can pass a nodeRef to the email template in url (if it will be GET webscript, and the email nodeRef is already in the Alfresco Repository). You can also pass the template in the POST webscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pawel Rzeszowski.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jan 2012 14:58:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-use-custom-email-template-4-sending-email-from-share/m-p/247622#M200752</guid>
      <dc:creator>pawel_rzeszowsk</dc:creator>
      <dc:date>2012-01-08T14:58:36Z</dc:date>
    </item>
  </channel>
</rss>

