<?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: Alfresco Email Send in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141594#M37723</link>
    <description>&lt;P&gt;Greatings angelborroy, this is the answer of JavaScript console:&lt;/P&gt;&lt;P&gt;Failed to execute script 'Javascript Console Script': Invalid bean definition with name 'global-properties' defined in class path resource [alfresco/core-services-context.xml]: Can only specify arguments for the getBean method when referring to a prototype bean definition&lt;/P&gt;&lt;P&gt;What I see, I haven't definition of core-services-context.xml in my system files of alfresco 5.2.&lt;/P&gt;&lt;P&gt;I'm looking in this repository &lt;A href="https://github.com/surevine/alfresco-repository-client-customisations/blob/master/config/alfresco/core-services-context.xml" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/surevine/alfresco-repository-client-customisations/blob/master/config/alfresco/core-services-context.xml&lt;/A&gt;, the way to get a solution to my problem, this is giving me many issues 'cause I didn't use LUCENE, im using SOLR4. Maybe if i could find the way to only get the bean around global-properties...&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2024 16:29:21 GMT</pubDate>
    <dc:creator>Shift</dc:creator>
    <dc:date>2024-02-21T16:29:21Z</dc:date>
    <item>
      <title>Alfresco Email Send</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141592#M37721</link>
      <description>&lt;P&gt;Hello, this is my alfresco-global.properties emails configurations.&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;...&lt;BR /&gt;### Email settings ###&lt;BR /&gt;mail.encoding=UTF-8&lt;BR /&gt;mail.host=smtp.uci.cu&lt;BR /&gt;mail.protocol=smtp&lt;BR /&gt;mail.port=587&lt;BR /&gt;mail.username=liomar@xxxx.cu&lt;BR /&gt;mail.password=****************&lt;BR /&gt;mail.from.default=liomar@xxxx.cu&lt;BR /&gt;mail.smtp.auth=true&lt;BR /&gt;mail.smtp.starttls.enable=true&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;It's working.&lt;/P&gt;&lt;P&gt;But I have a question: How can I use the same "mail.from.default" previously configured in alfresco-global.properties in the method sendMail created in JS.&lt;/P&gt;&lt;P&gt;function sendMail(email, subject, message, node) {&lt;BR /&gt;var mail = actions.create('mail');&lt;BR /&gt;mail.parameters.to = email;&lt;BR /&gt;mail.parameters.subject = subject;&lt;BR /&gt;mail.parameters.text = message;&lt;BR /&gt;mail.parameters.from = 'liomar@xxxx.cu';&lt;BR /&gt;// It is necessary to pass the created node&lt;BR /&gt;mail.execute(node);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;This method is working too, but I want to reuse the same parameter 'mail.from.default' previously configured without rewriting literally 'liomar@xxxx.cu';&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 20:35:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141592#M37721</guid>
      <dc:creator>Shift</dc:creator>
      <dc:date>2024-02-20T20:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco Email Send</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141593#M37722</link>
      <description>&lt;P&gt;It's not available in the JavaScript API, but you can recover the value with following code:&lt;/P&gt;
&lt;PRE&gt;var ctxt = &lt;BR /&gt;  Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var properties =&lt;BR /&gt;  ctxt.getBean('global-properties', java.util.Properties);

logger.log(properties["mail.from.default"]);&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Feb 2024 07:16:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141593#M37722</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2024-02-21T07:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco Email Send</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141594#M37723</link>
      <description>&lt;P&gt;Greatings angelborroy, this is the answer of JavaScript console:&lt;/P&gt;&lt;P&gt;Failed to execute script 'Javascript Console Script': Invalid bean definition with name 'global-properties' defined in class path resource [alfresco/core-services-context.xml]: Can only specify arguments for the getBean method when referring to a prototype bean definition&lt;/P&gt;&lt;P&gt;What I see, I haven't definition of core-services-context.xml in my system files of alfresco 5.2.&lt;/P&gt;&lt;P&gt;I'm looking in this repository &lt;A href="https://github.com/surevine/alfresco-repository-client-customisations/blob/master/config/alfresco/core-services-context.xml" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/surevine/alfresco-repository-client-customisations/blob/master/config/alfresco/core-services-context.xml&lt;/A&gt;, the way to get a solution to my problem, this is giving me many issues 'cause I didn't use LUCENE, im using SOLR4. Maybe if i could find the way to only get the bean around global-properties...&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 16:29:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141594#M37723</guid>
      <dc:creator>Shift</dc:creator>
      <dc:date>2024-02-21T16:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco Email Send</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141595#M37724</link>
      <description>&lt;P&gt;Thanks Angel, I found the solution using your code with the next changes:&lt;/P&gt;&lt;P&gt;Creation of a file custom-global-properties-context.xml in \tomcat\webapps\alfresco\WEB-INF\classes\alfresco that contains&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' '&lt;A href="http://www.springframework.org/dtd/spring-beans.dtd" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.springframework.org/dtd/spring-beans.dtd&lt;/A&gt;'&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;beans&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;lt;bean id="globalPropertiesBean" class="org.springframework.beans.factory.config.PropertiesFactoryBean"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;property name="locations"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;list&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;classpath*:alfresco-global.properties&amp;lt;/value&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/list&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/bean&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;/beans&amp;gt;&lt;/P&gt;&lt;P&gt;Creation of a file cgp.js in tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\scripts that contain&amp;nbsp;&lt;/P&gt;&lt;P&gt;var ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();&lt;/P&gt;&lt;P&gt;var ctxt_properties = ctxt.getBean('global-properties', java.util.Properties);&lt;/P&gt;&lt;P&gt;var ctxt_properties_mail_from_default = ctxt_properties["mail.from.default"];&lt;/P&gt;&lt;P&gt;That is all, you must use that in webscript service, but if you want use in JavaScript console, is important to write the next importation&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;import resource="classpath:alfresco/extension/scripts/cgp.js"&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 18:19:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/alfresco-email-send/m-p/141595#M37724</guid>
      <dc:creator>Shift</dc:creator>
      <dc:date>2024-02-27T18:19:43Z</dc:date>
    </item>
  </channel>
</rss>

